why deepstreamHub? compare us getting started faq
use cases
products
developers
company
blog contact

This object provides a number of methods that allow a RPC-provider to respond to a request

Methods

ack()

void ack()
Acknowledges the receipt of the request. This will happen implicitly unless the request callback explicitly sets autoAck to false

reject()

void reject()
Reject the request. This might be necessary if the client is already processing a large number of requests. If deepstream receives a rejection message it will try to route the request to another provider - or return a NO_RPC_PROVIDER error if there are no providers left

send(data)

void send(Object data)
argument type description
data Objet The response data. Has to be JsonSerializable

Completes the request by sending the response data to the server. If data is an array or object it will automatically be serialised. If autoAck is disabled and the response is sent before the ack message the request will still be completed and the ack message ignored

error(message)

void error(String errorMessage)
argument type description
errorMsg String The message used to describe the error that occured

Notifies deepstream that an error has occured while trying to process the request. This will complete the rpc.