|
Sync Android SDK
2.0.2
|
SyncStream is an ordered message delivery queue. More...
Classes | |
| interface | Message |
| Single message in a SyncStream. More... | |
Public Member Functions | |
| String | getSid () |
| An immutable system-assigned identifier of this Message SyncStream. More... | |
| String | getUniqueName () |
| An optional unique name for this stream, assigned at creation time. More... | |
| void | publishMessage (JSONObject data, SuccessListener< String > listener) |
| Publish a new message to this message stream. More... | |
| void | setTtl (int ttl, SuccessListener< Void > listener) |
| Set time to live for stream object in seconds. More... | |
| void | removeStream (SuccessListener< Void > listener) |
| Remove the stream from the system, deleting it. More... | |
Public Attributes | |
| int | INFINITE_DURATION = 0 |
| Time to live for a stream, specifying no expiry. | |
SyncStream is an ordered message delivery queue.
You can publish messages and listen for incoming messages.
To obtain an instance of a SyncStream use SyncClient#openStream.
| String com.twilio.sync.SyncStream.getSid | ( | ) |
An immutable system-assigned identifier of this Message SyncStream.
| String com.twilio.sync.SyncStream.getUniqueName | ( | ) |
An optional unique name for this stream, assigned at creation time.
| void com.twilio.sync.SyncStream.publishMessage | ( | JSONObject | data, |
| SuccessListener< String > | listener | ||
| ) |
Publish a new message to this message stream.
| data | Contains the payload of the dispatched message. Maximum size in serialized JSON: 4KB. |
| listener | Async result listener. See SuccessListener. |
| void com.twilio.sync.SyncStream.removeStream | ( | SuccessListener< Void > | listener | ) |
Remove the stream from the system, deleting it.
| listener | Async result listener. See SuccessListener. |
| void com.twilio.sync.SyncStream.setTtl | ( | int | ttl, |
| SuccessListener< Void > | listener | ||
| ) |
Set time to live for stream object in seconds.
This TTL specifies the minimum time the SyncStream will live, sometime soon after this time the object will be deleted.
If time to live is not specified, object lives infinitely long.
TTL could be used in order to auto-recycle old unused objects, but it is not recommended to build some app logic like timers using ttl.
| ttl | Time to live in seconds from now or INFINITE_DURATION to indicate no expiry. |
| listener | Async result listener. See SuccessListener. |