aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-server-ktor/src/main/kotlin/pl
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-10-22 23:18:59 +0200
committerRobert Jaros <rjaros@finn.pl>2019-10-22 23:18:59 +0200
commit69958b1a08f46aecd6ceda54780f362019150052 (patch)
treef42d65c65b832a9aef1a7e2e40f8bf8ac6e7224d /kvision-modules/kvision-server-ktor/src/main/kotlin/pl
parent5f109a1e92cd02df8b5588743ed141bc93542817 (diff)
downloadkvision-69958b1a08f46aecd6ceda54780f362019150052.tar.gz
kvision-69958b1a08f46aecd6ceda54780f362019150052.tar.bz2
kvision-69958b1a08f46aecd6ceda54780f362019150052.zip
Send additional state with SelectRemote request.
Diffstat (limited to 'kvision-modules/kvision-server-ktor/src/main/kotlin/pl')
-rw-r--r--kvision-modules/kvision-server-ktor/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/kvision-modules/kvision-server-ktor/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-server-ktor/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
index 36a7897e..e550be9c 100644
--- a/kvision-modules/kvision-server-ktor/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
+++ b/kvision-modules/kvision-server-ktor/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
@@ -443,17 +443,18 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass:
*/
@Suppress("TooGenericExceptionCaught")
protected actual fun bind(
- function: T.(String?, String?) -> List<RemoteOption>
+ function: T.(String?, String?, String?) -> List<RemoteOption>
) {
val routeDef = "route${this::class.simpleName}${counter++}"
addRoute(HttpMethod.POST, "/kv/$routeDef") {
val service = call.injector.createChildInjector(DummyWsSessionModule()).getInstance(serviceClass.java)
val jsonRpcRequest = call.receive<JsonRpcRequest>()
- if (jsonRpcRequest.params.size == 2) {
+ if (jsonRpcRequest.params.size == 3) {
val param1 = getParameter<String?>(jsonRpcRequest.params[0])
val param2 = getParameter<String?>(jsonRpcRequest.params[1])
+ val param3 = getParameter<String?>(jsonRpcRequest.params[2])
try {
- val result = function.invoke(service, param1, param2)
+ val result = function.invoke(service, param1, param2, param3)
call.respond(
JsonRpcResponse(
id = jsonRpcRequest.id,