From c3b1a2312f4110fcb344d71e83ee3f952534cdcf Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Thu, 13 Dec 2018 12:40:40 +0100 Subject: Major refactor of server side modules architecture. --- .../pl/treksoft/kvision/remote/JoobyServiceManager.kt | 14 ++++++-------- .../pl/treksoft/kvision/remote/SpringServiceManager.kt | 13 ++++++------- 2 files changed, 12 insertions(+), 15 deletions(-) (limited to 'kvision-modules/kvision-common/src/main/kotlin') diff --git a/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/JoobyServiceManager.kt b/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/JoobyServiceManager.kt index dceae898..cb1b44d0 100644 --- a/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/JoobyServiceManager.kt +++ b/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/JoobyServiceManager.kt @@ -21,8 +21,6 @@ */ package pl.treksoft.kvision.remote -import kotlinx.coroutines.Deferred - /** * Multiplatform service manager for Jooby. */ @@ -35,7 +33,7 @@ expect open class JoobyServiceManager(service: T) : ServiceManager { * @param method a HTTP method */ protected inline fun bind( - noinline function: T.(Request?) -> Deferred, + noinline function: suspend T.(Request?) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -47,7 +45,7 @@ expect open class JoobyServiceManager(service: T) : ServiceManager { * @param method a HTTP method */ protected inline fun bind( - noinline function: T.(PAR, Request?) -> Deferred, + noinline function: suspend T.(PAR, Request?) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -59,7 +57,7 @@ expect open class JoobyServiceManager(service: T) : ServiceManager { * @param method a HTTP method */ protected inline fun bind( - noinline function: T.(PAR1, PAR2, Request?) -> Deferred, + noinline function: suspend T.(PAR1, PAR2, Request?) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -71,7 +69,7 @@ expect open class JoobyServiceManager(service: T) : ServiceManager { * @param method a HTTP method */ protected inline fun bind( - noinline function: T.(PAR1, PAR2, PAR3, Request?) -> Deferred, + noinline function: suspend T.(PAR1, PAR2, PAR3, Request?) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -83,7 +81,7 @@ expect open class JoobyServiceManager(service: T) : ServiceManager { * @param method a HTTP method */ protected inline fun bind( - noinline function: T.(PAR1, PAR2, PAR3, PAR4, Request?) -> Deferred, + noinline function: suspend T.(PAR1, PAR2, PAR3, PAR4, Request?) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -95,7 +93,7 @@ expect open class JoobyServiceManager(service: T) : ServiceManager { * @param method a HTTP method */ protected inline fun bind( - noinline function: T.(PAR1, PAR2, PAR3, PAR4, PAR5, Request?) -> Deferred, + noinline function: suspend T.(PAR1, PAR2, PAR3, PAR4, PAR5, Request?) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) diff --git a/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/SpringServiceManager.kt b/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/SpringServiceManager.kt index 0e17d4e7..90926656 100644 --- a/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/SpringServiceManager.kt +++ b/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/SpringServiceManager.kt @@ -21,7 +21,6 @@ */ package pl.treksoft.kvision.remote -import kotlinx.coroutines.Deferred import kotlin.reflect.KClass /** @@ -36,7 +35,7 @@ expect open class SpringServiceManager(serviceClass: KClass) : Servi * @param method a HTTP method */ protected inline fun bind( - noinline function: T.() -> Deferred, + noinline function: suspend T.() -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -48,7 +47,7 @@ expect open class SpringServiceManager(serviceClass: KClass) : Servi * @param method a HTTP method */ protected inline fun bind( - noinline function: T.(PAR) -> Deferred, + noinline function: suspend T.(PAR) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -60,7 +59,7 @@ expect open class SpringServiceManager(serviceClass: KClass) : Servi * @param method a HTTP method */ protected inline fun bind( - noinline function: T.(PAR1, PAR2) -> Deferred, + noinline function: suspend T.(PAR1, PAR2) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -72,7 +71,7 @@ expect open class SpringServiceManager(serviceClass: KClass) : Servi * @param method a HTTP method */ protected inline fun bind( - noinline function: T.(PAR1, PAR2, PAR3) -> Deferred, + noinline function: suspend T.(PAR1, PAR2, PAR3) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -84,7 +83,7 @@ expect open class SpringServiceManager(serviceClass: KClass) : Servi * @param method a HTTP method */ protected inline fun bind( - noinline function: T.(PAR1, PAR2, PAR3, PAR4) -> Deferred, + noinline function: suspend T.(PAR1, PAR2, PAR3, PAR4) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -96,7 +95,7 @@ expect open class SpringServiceManager(serviceClass: KClass) : Servi * @param method a HTTP method */ protected inline fun bind( - noinline function: T.(PAR1, PAR2, PAR3, PAR4, PAR5) -> Deferred, + noinline function: suspend T.(PAR1, PAR2, PAR3, PAR4, PAR5) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) -- cgit