diff options
author | Robert Jaros <rjaros@finn.pl> | 2020-03-12 13:15:21 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2020-03-12 13:15:21 +0100 |
commit | b862dc8bcde84023a001deabaaa7fe119bd649e5 (patch) | |
tree | fe26b736df0d24f3dc4a177a1d3d6c60f5a5c41e | |
parent | f09f567cc46717887d24d3e197e09605ddf414b7 (diff) | |
download | kvision-b862dc8bcde84023a001deabaaa7fe119bd649e5.tar.gz kvision-b862dc8bcde84023a001deabaaa7fe119bd649e5.tar.bz2 kvision-b862dc8bcde84023a001deabaaa7fe119bd649e5.zip |
Ktor upgrade to 1.3.2
-rw-r--r-- | gradle.properties | 2 | ||||
-rw-r--r-- | kvision-modules/kvision-server-ktor/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/gradle.properties b/gradle.properties index db8b8126..7439818d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ serializationVersion=0.20.0 systemProp.dokkaVersion=0.10.1 joobyVersion=2.6.1 springBootVersion=2.2.5.RELEASE -ktorVersion=1.3.1 +ktorVersion=1.3.2 javalinVersion=3.7.0 guiceVersion=4.2.2 jacksonModuleKotlinVersion=2.10.3 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<T : Any> actual constructor(val serviceClass: KClass<T>) { companion object { @@ -399,6 +396,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) @Suppress("EmptyCatchBlock") protected actual inline fun <reified PAR1 : Any, reified PAR2 : Any> bind( noinline function: suspend T.(ReceiveChannel<PAR1>, SendChannel<PAR2>) -> Unit, @@ -465,8 +463,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 { @@ -532,7 +532,6 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass: /** * A function to generate routes based on definitions from the service manager. */ -@KtorExperimentalAPI fun <T : Any> Route.applyRoutes(serviceManager: KVServiceManager<T>) { serviceManager.getRequests.forEach { (path, handler) -> get(path, handler) |