|
Sync Android SDK
2.0.1
|
Observer for all operations on a SyncStream. More...
Public Member Functions | |
| SyncStreamObserver () | |
| Keep default constructor, you don't need to override it. More... | |
| void | onOpened (SyncStream syncStream) |
| This callback is invoked when SyncStream object has been initialised and opened locally. More... | |
| void | onRemoved (EventContext context) |
| This callback is invoked when the SyncStream has been removed. More... | |
| void | onMessagePublished (EventContext context, SyncStream.Message message) |
| This callback is invoked when SyncStream has successfully published a message. More... | |
| void | onErrorOccurred (ErrorInfo error) |
| This callback is invoked when a SyncStream operation has encountered a error in local request. More... | |
Observer for all operations on a SyncStream.
You should create your own subclass of StreamObserver and override functions you are interested in.
Observer will receive callbacks for all operations on a SyncStream. 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.SyncStreamObserver.SyncStreamObserver | ( | ) |
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.SyncStreamObserver.onErrorOccurred | ( | ErrorInfo | error | ) |
This callback is invoked when a SyncStream operation has encountered a error in local request.
| error | Error description. |
| void com.twilio.sync.SyncStreamObserver.onMessagePublished | ( | EventContext | context, |
| SyncStream.Message | message | ||
| ) |
This callback is invoked when SyncStream has successfully published a message.
| context | Context indicating if change was local or remote. |
| message | Snapshot of the received message. |
| void com.twilio.sync.SyncStreamObserver.onOpened | ( | SyncStream | syncStream | ) |
This callback is invoked when SyncStream object has been initialised and opened locally.
| syncStream | SyncStream object that has been opened. This parameter you should take and use as your initialised instance of a stream. |
| void com.twilio.sync.SyncStreamObserver.onRemoved | ( | EventContext | context | ) |
This callback is invoked when the SyncStream has been removed.
| context | Context indicating if change was local or remote. |