From b862dc8bcde84023a001deabaaa7fe119bd649e5 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Thu, 12 Mar 2020 13:15:21 +0100 Subject: Ktor upgrade to 1.3.2 --- .../kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'kvision-modules/kvision-server-ktor/src/jvmMain') diff --git a/kvision-modules/kvision-server-ktor/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-server-ktor/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt index d516f2b3..25771091 100644 --- a/kvision-modules/kvision-server-ktor/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt +++ b/kvision-modules/kvision-server-ktor/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt @@ -38,7 +38,6 @@ import io.ktor.routing.get import io.ktor.routing.options import io.ktor.routing.post import io.ktor.routing.put -import io.ktor.util.KtorExperimentalAPI import io.ktor.util.pipeline.PipelineContext import io.ktor.websocket.WebSocketServerSession import io.ktor.websocket.webSocket @@ -63,9 +62,7 @@ import kotlin.reflect.KClass /** * Multiplatform service manager for Ktor. */ -@KtorExperimentalAPI -@OptIn(ExperimentalCoroutinesApi::class) -@Suppress("LargeClass", "TooManyFunctions") +@Suppress("LargeClass", "TooManyFunctions", "BlockingMethodInNonBlockingContext") actual open class KVServiceManager actual constructor(val serviceClass: KClass) { companion object { @@ -399,6 +396,7 @@ actual open class KVServiceManager actual constructor(val serviceClass: * @param function a function of the receiver * @param route a route */ + @OptIn(ExperimentalCoroutinesApi::class) @Suppress("EmptyCatchBlock") protected actual inline fun bind( noinline function: suspend T.(ReceiveChannel, SendChannel) -> Unit, @@ -465,8 +463,10 @@ actual open class KVServiceManager actual constructor(val serviceClass: val param1 = getParameter(jsonRpcRequest.params[0]) val param2 = getParameter(jsonRpcRequest.params[1]) val param3 = getParameter?>(jsonRpcRequest.params[2]) + @Suppress("MagicNumber") val param4 = getParameter?>(jsonRpcRequest.params[3]) + @Suppress("MagicNumber") val param5 = getParameter(jsonRpcRequest.params[4]) try { @@ -532,7 +532,6 @@ actual open class KVServiceManager actual constructor(val serviceClass: /** * A function to generate routes based on definitions from the service manager. */ -@KtorExperimentalAPI fun Route.applyRoutes(serviceManager: KVServiceManager) { serviceManager.getRequests.forEach { (path, handler) -> get(path, handler) -- cgit