aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kvision-modules/kvision-common-remote/src/jsMain/kotlin/pl/treksoft/kvision/remote/KVRemoteAgent.kt4
-rw-r--r--kvision-modules/kvision-server-javalin/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt4
-rw-r--r--kvision-modules/kvision-server-jooby/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt4
-rw-r--r--kvision-modules/kvision-server-spring-boot/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt9
-rw-r--r--kvision-modules/kvision-server-spring-boot/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVWebSocketConfig.kt5
5 files changed, 11 insertions, 15 deletions
diff --git a/kvision-modules/kvision-common-remote/src/jsMain/kotlin/pl/treksoft/kvision/remote/KVRemoteAgent.kt b/kvision-modules/kvision-common-remote/src/jsMain/kotlin/pl/treksoft/kvision/remote/KVRemoteAgent.kt
index 62657b3d..232e0607 100644
--- a/kvision-modules/kvision-common-remote/src/jsMain/kotlin/pl/treksoft/kvision/remote/KVRemoteAgent.kt
+++ b/kvision-modules/kvision-common-remote/src/jsMain/kotlin/pl/treksoft/kvision/remote/KVRemoteAgent.kt
@@ -39,9 +39,7 @@ import kotlin.reflect.KClass
* Client side agent for JSON-RPC remote calls.
*/
@Suppress("LargeClass", "TooManyFunctions")
-@OptIn(
- ImplicitReflectionSerializer::class, ExperimentalCoroutinesApi::class
-)
+@OptIn(ImplicitReflectionSerializer::class, ExperimentalCoroutinesApi::class)
open class KVRemoteAgent<T : Any>(val serviceManager: KVServiceMgr<T>) :
RemoteAgent {
diff --git a/kvision-modules/kvision-server-javalin/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-server-javalin/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
index e6428524..e3189a74 100644
--- a/kvision-modules/kvision-server-javalin/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
+++ b/kvision-modules/kvision-server-javalin/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
@@ -53,8 +53,7 @@ import kotlin.reflect.KClass
/**
* Multiplatform service manager for Javalin.
*/
-@Suppress("LargeClass", "TooManyFunctions")
-@OptIn(ExperimentalCoroutinesApi::class)
+@Suppress("LargeClass", "TooManyFunctions", "BlockingMethodInNonBlockingContext")
actual open class KVServiceManager<T : Any> actual constructor(val serviceClass: KClass<T>) {
companion object {
@@ -389,6 +388,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?
diff --git a/kvision-modules/kvision-server-jooby/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-server-jooby/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
index 6bc2a73a..befeca22 100644
--- a/kvision-modules/kvision-server-jooby/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
+++ b/kvision-modules/kvision-server-jooby/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
@@ -53,8 +53,7 @@ import kotlin.reflect.KClass
/**
* Multiplatform service manager for Jooby.
*/
-@Suppress("LargeClass", "TooManyFunctions")
-@OptIn(ExperimentalCoroutinesApi::class)
+@Suppress("LargeClass", "TooManyFunctions", "BlockingMethodInNonBlockingContext")
actual open class KVServiceManager<T : Any> actual constructor(val serviceClass: KClass<T>) {
companion object {
@@ -351,6 +350,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?
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>()