public interface IMqttActionListener
A listener is registered on an MqttToken and a token is associated with an action like connect or publish. When used with tokens on the MqttAsyncClient the listener will be called back on the MQTT client's thread. The listener will be informed if the action succeeds or fails. It is important that the listener returns control quickly otherwise the operation of the MQTT client will be stalled.
Modifier and Type | Method and Description |
---|---|
void |
onFailure(IMqttToken asyncActionToken,
Throwable exception)
This method is invoked when an action fails.
|
void |
onSuccess(IMqttToken asyncActionToken)
This method is invoked when an action has completed successfully.
|
void onFailure(IMqttToken asyncActionToken, Throwable exception)
asyncActionToken
- associated with the action that has failedvoid onSuccess(IMqttToken asyncActionToken)
asyncActionToken
- associated with the action that has completed