Open pangiole opened 7 years ago
Having the following registration in place:
def sum(a: Int, b: Int) = a + b
val registration: Future[Registration] = session.flatMap(
_.register(
procedure = "myapp.procedure.sum",
handler = sum _ ))
// registration.id == 4
The the following JSON invocation message:
[68,9,4,{},[],{"a":45,"b":25}]
would make AkkaWamp invoke sum(45, 25)
You can register a procedure URI with a partially applied function as handler.
Akka Wamp will dinamically invoke the partially applied function you provide (e.g.
sum _
) upon receiving invocations addressed to the registered procedure URI (e.g."myapp.procedure.sum"
). It will lazily deserialize theargs
list from incoming payloads by using its default type bindings.