API reference
API reference
Select your platform
No SDKs available
No versions available

Request Class

This class is used to represent a request to a server or a system service. Each request will have a unique request Id that is used to map it to the Message that is returned.

Member Functions

Request
( long requestId )
Set the success callback for this request. The callback should only be set once, or a RuntimeException will be thrown.
Parameters
handler
The handler to call when the request succeeds.
Returns
the request.
Set the error callback for this request. The callback should only be set once, or a RuntimeException will be thrown.
Parameters
handler
The handler to call when the request fails.
Returns
the request.
long getRequestId ( )

Static Member Functions

Handle an incoming message by calling the appropriate callback for the request associated with it. Callbacks registered to the exact requestId will be delivered. If there's no exact match with a specific request, then we will attempt to deliver to the registered notification callback for the message type.To handle messages yourself, you should call runCallbacks() instead.
Parameters
message
The message to handle.
This will run callbacks on all messages that are returned from the server, up to the provided limit. This will limit the number of messages to run callbacks on at a time.
Parameters
limit
the maximum number of messages to process
Pops all available messages from the queue and handles them by calling the appropriate request callbacks.This will run callbacks on all messages that are returned from the server. This will not return until all messages in the queue have been handled/delivered.

Object Data for package-static-func

static void setNotificationCallback
( Message.MessageType type,
Handler onSuccess,
Handler< Error > onError )
Did you find this page helpful?
Thumbs up icon
Thumbs down icon