|
Sync Android SDK
0.8.5
|
Observer for all operations on a Stream. More...
Public Member Functions | |
| StreamObserver () | |
| Keep default constructor, you don't need to override it. More... | |
| void | onOpened (Stream stream) |
| This callback is invoked when Stream object has been initialised and opened locally. More... | |
| void | onRemoved (EventContext context) |
| This callback is invoked when the Stream has been removed. More... | |
| void | onMessagePublished (EventContext context, Stream.Message message) |
| This callback is invoked when Stream has successfully published a message. More... | |
| void | onErrorOccurred (ErrorInfo error) |
| This callback is invoked when a Stream operation has encountered a error in local request. More... | |
Observer for all operations on a Stream.
You should create your own subclass of StreamObserver and override functions you are interested in.
Observer will receive callbacks for all operations on a Stream. To distinguish parallel streams of local operations your application could use local flow identifier.
Callbacks in the observer will be called from a background thread. You will need to repost your work to UI thread if you do any UI-related operations in the callback.
| com.twilio.sync.StreamObserver.StreamObserver | ( | ) |
Keep default constructor, you don't need to override it.
If you do override make sure to call the inherited constructor.
| void com.twilio.sync.StreamObserver.onErrorOccurred | ( | ErrorInfo | error | ) |
This callback is invoked when a Stream operation has encountered a error in local request.
| error | Error description. |
| void com.twilio.sync.StreamObserver.onMessagePublished | ( | EventContext | context, |
| Stream.Message | message | ||
| ) |
This callback is invoked when Stream has successfully published a message.
| context | Context indicating if change was local or remote. |
| message | Snapshot of the received message. |
| void com.twilio.sync.StreamObserver.onOpened | ( | Stream | stream | ) |
| void com.twilio.sync.StreamObserver.onRemoved | ( | EventContext | context | ) |
This callback is invoked when the Stream has been removed.
| context | Context indicating if change was local or remote. |