diff options
author | Robert Jaros <rjaros@finn.pl> | 2020-03-12 13:16:04 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2020-03-12 13:16:04 +0100 |
commit | 5f8443b94a94c6fc5cdecf2c91d89b48e3eb6598 (patch) | |
tree | f2de4c8eb7cdde71896bc24d39b034f274c13f63 /kvision-modules/kvision-server-spring-boot/src/jvmMain | |
parent | b862dc8bcde84023a001deabaaa7fe119bd649e5 (diff) | |
download | kvision-5f8443b94a94c6fc5cdecf2c91d89b48e3eb6598.tar.gz kvision-5f8443b94a94c6fc5cdecf2c91d89b48e3eb6598.tar.bz2 kvision-5f8443b94a94c6fc5cdecf2c91d89b48e3eb6598.zip |
Remove some experimental annotations
Diffstat (limited to 'kvision-modules/kvision-server-spring-boot/src/jvmMain')
2 files changed, 6 insertions, 8 deletions
diff --git a/kvision-modules/kvision-server-spring-boot/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-server-spring-boot/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt index 4c1d8e6a..c4855466 100644 --- a/kvision-modules/kvision-server-spring-boot/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt +++ b/kvision-modules/kvision-server-spring-boot/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt @@ -24,7 +24,6 @@ package pl.treksoft.kvision.remote import com.fasterxml.jackson.databind.module.SimpleModule import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper import com.fasterxml.jackson.module.kotlin.readValue -import kotlinx.coroutines.CoroutineStart import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.ReceiveChannel @@ -53,8 +52,7 @@ import kotlin.reflect.KClass /** * Multiplatform service manager for Spring Boot. */ -@OptIn(ExperimentalCoroutinesApi::class) -@Suppress("LargeClass", "TooManyFunctions") +@Suppress("LargeClass", "TooManyFunctions", "BlockingMethodInNonBlockingContext") actual open class KVServiceManager<T : Any> actual constructor(val serviceClass: KClass<T>) { companion object { @@ -450,6 +448,7 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass: * @param function a function of the receiver * @param route a route */ + @OptIn(ExperimentalCoroutinesApi::class) protected actual inline fun <reified PAR1 : Any, reified PAR2 : Any> bind( noinline function: suspend T.(ReceiveChannel<PAR1>, SendChannel<PAR2>) -> Unit, route: String? @@ -489,7 +488,7 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass: } if (!incoming.isClosedForReceive) incoming.cancel() } - launch(start = CoroutineStart.UNDISPATCHED) { + launch { function.invoke(service, requestChannel, responseChannel) if (!responseChannel.isClosedForReceive) responseChannel.close() } @@ -515,8 +514,10 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass: val param1 = getParameter<Int?>(jsonRpcRequest.params[0]) val param2 = getParameter<Int?>(jsonRpcRequest.params[1]) val param3 = getParameter<List<RemoteFilter>?>(jsonRpcRequest.params[2]) + @Suppress("MagicNumber") val param4 = getParameter<List<RemoteSorter>?>(jsonRpcRequest.params[3]) + @Suppress("MagicNumber") val param5 = getParameter<String?>(jsonRpcRequest.params[4]) try { diff --git a/kvision-modules/kvision-server-spring-boot/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVWebSocketConfig.kt b/kvision-modules/kvision-server-spring-boot/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVWebSocketConfig.kt index 3c0e4e99..d707f6c4 100644 --- a/kvision-modules/kvision-server-spring-boot/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVWebSocketConfig.kt +++ b/kvision-modules/kvision-server-spring-boot/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVWebSocketConfig.kt @@ -24,7 +24,6 @@ package pl.treksoft.kvision.remote import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.async import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.ReceiveChannel @@ -63,9 +62,7 @@ class KVWebSocketHandler( }.first() } - @OptIn( - ExperimentalCoroutinesApi::class, FlowPreview::class - ) + @OptIn(ExperimentalCoroutinesApi::class) override fun handle(session: WebSocketSession): Mono<Void> { val handler = getHandler(session) val responseChannel = Channel<String>() |