diff options
author | Robert Jaros <rjaros@finn.pl> | 2020-04-18 20:20:21 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2020-04-18 20:20:21 +0200 |
commit | 80f33eae37fff276f538ce43d2b0e18f773a839b (patch) | |
tree | 1c788e268e7042656db9cc4a62592d890fe12f53 /kvision-modules/kvision-server-ktor/src/jvmMain/kotlin/pl | |
parent | 7b994ca5d71f195781ac129f3d3d180fb79c7380 (diff) | |
download | kvision-80f33eae37fff276f538ce43d2b0e18f773a839b.tar.gz kvision-80f33eae37fff276f538ce43d2b0e18f773a839b.tar.bz2 kvision-80f33eae37fff276f538ce43d2b0e18f773a839b.zip |
Support for method annotations for compiler plugin (#142)
Diffstat (limited to 'kvision-modules/kvision-server-ktor/src/jvmMain/kotlin/pl')
-rw-r--r-- | kvision-modules/kvision-server-ktor/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt | 7 |
1 files changed, 4 insertions, 3 deletions
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 aee92d31..9d0bf3de 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 @@ -457,7 +457,7 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass: noinline function: suspend T.(ReceiveChannel<PAR1>, SendChannel<PAR2>) -> Unit, route: String? ) { - val routeDef = "route${this::class.simpleName}${counter++}" + val routeDef = route ?: "route${this::class.simpleName}${counter++}" webSocketRequests["/kvws/$routeDef"] = { val wsInjector = call.injector.createChildInjector(WsSessionModule(this)) val service = wsInjector.getInstance(serviceClass.java) @@ -507,9 +507,10 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass: */ @Suppress("TooGenericExceptionCaught") protected actual inline fun <reified RET> bindTabulatorRemote( - noinline function: suspend T.(Int?, Int?, List<RemoteFilter>?, List<RemoteSorter>?, String?) -> RemoteData<RET> + noinline function: suspend T.(Int?, Int?, List<RemoteFilter>?, List<RemoteSorter>?, String?) -> RemoteData<RET>, + route: String? ) { - val routeDef = "route${this::class.simpleName}${counter++}" + val routeDef = route ?: "route${this::class.simpleName}${counter++}" addRoute(HttpMethod.POST, "/kv/$routeDef") { val service = call.injector.createChildInjector(DummyWsSessionModule()).getInstance(serviceClass.java) val jsonRpcRequest = call.receive<JsonRpcRequest>() |