diff options
author | Robert Jaros <rjaros@finn.pl> | 2018-12-13 12:40:40 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2018-12-13 12:40:40 +0100 |
commit | c3b1a2312f4110fcb344d71e83ee3f952534cdcf (patch) | |
tree | 7c491bf4b45a43386b520313cbb62f84dae6a9ce /kvision-modules/kvision-common/src | |
parent | 6370bb46a7e47f308ee24f1a32ab8d8cf309dedf (diff) | |
download | kvision-c3b1a2312f4110fcb344d71e83ee3f952534cdcf.tar.gz kvision-c3b1a2312f4110fcb344d71e83ee3f952534cdcf.tar.bz2 kvision-c3b1a2312f4110fcb344d71e83ee3f952534cdcf.zip |
Major refactor of server side modules architecture.
Diffstat (limited to 'kvision-modules/kvision-common/src')
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 ) |