|
Sync Android SDK
0.9.0
|
Stream is an ordered message delivery queue. More...
Classes | |
| class | Message |
| Single message in a Stream. More... | |
Public Member Functions | |
| native String | getSid () |
| An immutable system-assigned identifier of this Message Stream. More... | |
| native 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 | |
| final int | InfiniteDuration = 0 |
| Time to live for a stream, specifying no expiry. | |
Stream is an ordered message delivery queue.
You can publish messages and listen for incoming messages.
To obtain an instance of a Stream use SyncClient#openStream.
| native String com.twilio.sync.Stream.getSid | ( | ) |
| native String com.twilio.sync.Stream.getUniqueName | ( | ) |
An optional unique name for this stream, assigned at creation time.
| void com.twilio.sync.Stream.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.Stream.removeStream | ( | SuccessListener< Void > | listener | ) |
Remove the stream from the system, deleting it.
| listener | Async result listener. See SuccessListener. |
| void com.twilio.sync.Stream.setTtl | ( | int | ttl, |
| SuccessListener< Void > | listener | ||
| ) |
Set time to live for stream object in seconds.
This TTL specifies the minimum time the Stream 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 InfiniteDuration to indicate no expiry. |
| listener | Async result listener. See SuccessListener. |