diff options
author | Robert Jaros <rjaros@finn.pl> | 2019-10-14 00:09:48 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2019-10-14 00:09:48 +0200 |
commit | d3387ef87eeae165e904612d6e81890011b5b48e (patch) | |
tree | 828c5cbbeb38bd35e66bc1deddc1e6c19fd0bf4e /kvision-modules/kvision-server-spring-boot | |
parent | 61c073b47341059e139011a6ed4734cb49745919 (diff) | |
download | kvision-d3387ef87eeae165e904612d6e81890011b5b48e.tar.gz kvision-d3387ef87eeae165e904612d6e81890011b5b48e.tar.bz2 kvision-d3387ef87eeae165e904612d6e81890011b5b48e.zip |
Remove deprecated API call
Diffstat (limited to 'kvision-modules/kvision-server-spring-boot')
-rw-r--r-- | kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVWebSocketConfig.kt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVWebSocketConfig.kt b/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVWebSocketConfig.kt index 482c2526..2c74e611 100644 --- a/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVWebSocketConfig.kt +++ b/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVWebSocketConfig.kt @@ -24,13 +24,14 @@ package pl.treksoft.kvision.remote import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.ObsoleteCoroutinesApi +import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.async import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.ReceiveChannel import kotlinx.coroutines.channels.SendChannel import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.flow.collect +import kotlinx.coroutines.flow.consumeAsFlow import kotlinx.coroutines.launch import kotlinx.coroutines.reactive.asFlow import kotlinx.coroutines.reactor.asFlux @@ -62,12 +63,12 @@ class KVWebSocketHandler( }.first() } - @UseExperimental(ObsoleteCoroutinesApi::class, ExperimentalCoroutinesApi::class) + @UseExperimental(ExperimentalCoroutinesApi::class, FlowPreview::class) override fun handle(session: WebSocketSession): Mono<Void> { val handler = getHandler(session) val responseChannel = Channel<String>() val requestChannel = Channel<String>() - val output = session.send(responseChannel.asFlux(EmptyCoroutineContext).map(session::textMessage)) + val output = session.send(responseChannel.consumeAsFlow().asFlux().map(session::textMessage)) val input = async { coroutineScope { launch { |