diff options
Diffstat (limited to 'sw-server/src/main/kotlin/org')
-rw-r--r-- | sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt | 16 |
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() +} |