diff options
Diffstat (limited to 'kvision-modules/kvision-common/src/main/kotlin/pl/treksoft')
2 files changed, 12 insertions, 15 deletions
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<T : Any>(service: T) : ServiceManager { * @param method a HTTP method */ protected inline fun <reified RET> bind( - noinline function: T.(Request?) -> Deferred<RET>, + noinline function: suspend T.(Request?) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -47,7 +45,7 @@ expect open class JoobyServiceManager<T : Any>(service: T) : ServiceManager { * @param method a HTTP method */ protected inline fun <reified PAR, reified RET> bind( - noinline function: T.(PAR, Request?) -> Deferred<RET>, + noinline function: suspend T.(PAR, Request?) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -59,7 +57,7 @@ expect open class JoobyServiceManager<T : Any>(service: T) : ServiceManager { * @param method a HTTP method */ protected inline fun <reified PAR1, reified PAR2, reified RET> bind( - noinline function: T.(PAR1, PAR2, Request?) -> Deferred<RET>, + noinline function: suspend T.(PAR1, PAR2, Request?) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -71,7 +69,7 @@ expect open class JoobyServiceManager<T : Any>(service: T) : ServiceManager { * @param method a HTTP method */ protected inline fun <reified PAR1, reified PAR2, reified PAR3, reified RET> bind( - noinline function: T.(PAR1, PAR2, PAR3, Request?) -> Deferred<RET>, + noinline function: suspend T.(PAR1, PAR2, PAR3, Request?) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -83,7 +81,7 @@ expect open class JoobyServiceManager<T : Any>(service: T) : ServiceManager { * @param method a HTTP method */ protected inline fun <reified PAR1, reified PAR2, reified PAR3, reified PAR4, reified RET> bind( - noinline function: T.(PAR1, PAR2, PAR3, PAR4, Request?) -> Deferred<RET>, + 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<T : Any>(service: T) : ServiceManager { * @param method a HTTP method */ protected inline fun <reified PAR1, reified PAR2, reified PAR3, reified PAR4, reified PAR5, reified RET> bind( - noinline function: T.(PAR1, PAR2, PAR3, PAR4, PAR5, Request?) -> Deferred<RET>, + 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<T : Any>(serviceClass: KClass<T>) : Servi * @param method a HTTP method */ protected inline fun <reified RET> bind( - noinline function: T.() -> Deferred<RET>, + noinline function: suspend T.() -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -48,7 +47,7 @@ expect open class SpringServiceManager<T : Any>(serviceClass: KClass<T>) : Servi * @param method a HTTP method */ protected inline fun <reified PAR, reified RET> bind( - noinline function: T.(PAR) -> Deferred<RET>, + noinline function: suspend T.(PAR) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -60,7 +59,7 @@ expect open class SpringServiceManager<T : Any>(serviceClass: KClass<T>) : Servi * @param method a HTTP method */ protected inline fun <reified PAR1, reified PAR2, reified RET> bind( - noinline function: T.(PAR1, PAR2) -> Deferred<RET>, + noinline function: suspend T.(PAR1, PAR2) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -72,7 +71,7 @@ expect open class SpringServiceManager<T : Any>(serviceClass: KClass<T>) : Servi * @param method a HTTP method */ protected inline fun <reified PAR1, reified PAR2, reified PAR3, reified RET> bind( - noinline function: T.(PAR1, PAR2, PAR3) -> Deferred<RET>, + noinline function: suspend T.(PAR1, PAR2, PAR3) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -84,7 +83,7 @@ expect open class SpringServiceManager<T : Any>(serviceClass: KClass<T>) : Servi * @param method a HTTP method */ protected inline fun <reified PAR1, reified PAR2, reified PAR3, reified PAR4, reified RET> bind( - noinline function: T.(PAR1, PAR2, PAR3, PAR4) -> Deferred<RET>, + noinline function: suspend T.(PAR1, PAR2, PAR3, PAR4) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) @@ -96,7 +95,7 @@ expect open class SpringServiceManager<T : Any>(serviceClass: KClass<T>) : Servi * @param method a HTTP method */ protected inline fun <reified PAR1, reified PAR2, reified PAR3, reified PAR4, reified PAR5, reified RET> bind( - noinline function: T.(PAR1, PAR2, PAR3, PAR4, PAR5) -> Deferred<RET>, + noinline function: suspend T.(PAR1, PAR2, PAR3, PAR4, PAR5) -> RET, route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST ) |