summaryrefslogtreecommitdiff
path: root/sw-server/src/main/kotlin/org/luxons
diff options
context:
space:
mode:
authorjoffrey-bion <joffrey.bion@gmail.com>2021-02-08 18:22:27 +0100
committerjoffrey-bion <joffrey.bion@gmail.com>2021-02-08 19:54:05 +0100
commit364e2ced394f80bb3f5a1e6c6371ac287e13c748 (patch)
treef428a3490b35b4f265441f0df823b942fe601985 /sw-server/src/main/kotlin/org/luxons
parentAdd namespace in status check (diff)
downloadseven-wonders-364e2ced394f80bb3f5a1e6c6371ac287e13c748.tar.gz
seven-wonders-364e2ced394f80bb3f5a1e6c6371ac287e13c748.tar.bz2
seven-wonders-364e2ced394f80bb3f5a1e6c6371ac287e13c748.zip
Cleanup web socket config
Diffstat (limited to 'sw-server/src/main/kotlin/org/luxons')
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt16
1 files changed, 7 insertions, 9 deletions
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt
index 2782c670..86642258 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt
@@ -30,12 +30,6 @@ class WebSocketConfig(
config.setApplicationDestinationPrefixes("/app", "/topic")
}
- private fun createTaskScheduler() = ThreadPoolTaskScheduler().apply {
- poolSize = 1
- threadNamePrefix = "stomp-heartbeat-thread-"
- initialize()
- }
-
override fun registerStompEndpoints(registry: StompEndpointRegistry) {
registry.addEndpoint(SEVEN_WONDERS_WS_ENDPOINT)
.setHandshakeHandler(handshakeHandler())
@@ -43,9 +37,7 @@ class WebSocketConfig(
}
@Bean
- fun handshakeHandler(): DefaultHandshakeHandler {
- return AnonymousUsersHandshakeHandler()
- }
+ fun handshakeHandler(): DefaultHandshakeHandler = AnonymousUsersHandshakeHandler()
override fun configureClientInboundChannel(registration: ChannelRegistration) {
registration.interceptors(topicSubscriptionInterceptor)
@@ -56,3 +48,9 @@ class WebSocketConfig(
return true
}
}
+
+private fun createTaskScheduler() = ThreadPoolTaskScheduler().apply {
+ poolSize = 1
+ threadNamePrefix = "stomp-heartbeat-thread-"
+ initialize()
+}
bgstack15