Request
(
requestId
)
|
Signature
com.meta.horizon.platform.ovr.requests.Request< T >.Request(long requestId) Parameters requestId: long |
getRequestId
()
|
Signature
long com.meta.horizon.platform.ovr.requests.Request< T >.getRequestId() Returns long |
onError
(
handler
)
|
Set the error callback for this request. The callback should only be set once, or a RuntimeException will be thrown.
Signature
Request<T> com.meta.horizon.platform.ovr.requests.Request< T >.onError(Handler< Error > handler) Parameters |
onSuccess
(
handler
)
|
Set the success callback for this request. The callback should only be set once, or a RuntimeException will be thrown.
Signature
Request<T> com.meta.horizon.platform.ovr.requests.Request< T >.onSuccess(Handler< T > handler) Parameters handler: Handler< T >Â
The handler to call when the request succeeds.
|
handleMessage
(
message
)
|
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.
Signature
static synchronized void com.meta.horizon.platform.ovr.requests.Request< T >.handleMessage(final Message message) Parameters Returns synchronized void |
runCallbacks
(
limit
)
|
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.
Signature
static void com.meta.horizon.platform.ovr.requests.Request< T >.runCallbacks(int limit) Parameters limit: intÂ
the maximum number of messages to process
Returns void |
runCallbacks
()
|
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.
Signature
static void com.meta.horizon.platform.ovr.requests.Request< T >.runCallbacks() Returns void |
setNotificationCallback
(
type
, onSuccess
, onError
)
|
Signature
static void com.meta.horizon.platform.ovr.requests.Request< T >.setNotificationCallback(Message.MessageType type, Handler onSuccess, Handler< Error > onError) Parameters Returns void |
handle
(
payload
)
|
This will be called when the message is handled.
Signature
void com.meta.horizon.platform.ovr.requests.Request< T >.Handler< T >.handle(T payload) Parameters payload: TÂ
The payload of the message.
Returns void |