CommunicationsServiceHandler
Interface for service handlers.
Generated service stub instances provide a CommunicationsServiceHandler, which when called will call the appropriate function on the stub instance. The service handler can be obtained by calling stub.toServiceHandler()
.
When initializing a generated service client proxy instance a CommunicationsServiceHandler should be provided. All calls into the client proxy will cause a call into the provided service handler. The service handler can then generate the appropriate protocol messages for those calls.
There are two kinds of remote calls. A simple function call, which only returns once. And a streaming function call that can return multiple values.
Functions
When called by the generated service client proxy implementation it calls the remote method with the specified methodId and the specified message as method call arguments. A ByteString should be returned as return value for the method call. If the remote call cannot be completed it fails by throwing a CancellationException.
When called by generated service client proxy implementations, it calls the remote streaming method with the specified methodId and the specified message as method call arguments. Multiple results can be returned by calling the specified resultCallback zero or more times. If the remote call cannot be completed or is canceled (e.g. by disconnection) it fails by throwing a CancellationException.