SyncStreamJava

Interface for Sync Pub-sub messaging primitive.

Message Stream is a Sync primitive for real-time pub-sub messaging. Stream Messages are not persisted, they exist only in transit, and will be dropped if (due to congestion or network anomalies) they cannot be delivered promptly.

You can publish Messages and listen for incoming Messages.

To obtain an instance of a SyncStreamJava use SyncClientJava.streams.

Types

Link copied to clipboard
interface Listener

Listener for all operations on a SyncStreamJava.

Link copied to clipboard
data class Message(val sid: String, val jsonData: String)

Single message in a SyncStreamJava.

Properties

Link copied to clipboard
abstract val dateExpires: Long?

A date this SyncStreamJava will expire, null means will not expire.

Link copied to clipboard
abstract val isFromCache: Boolean

true when this SyncStreamJava is offline and doesn't receive updates from backend, false otherwise.

Link copied to clipboard
abstract val isRemoved: Boolean

true when this SyncStreamJava has been removed on the backend, false otherwise.

Link copied to clipboard
abstract val sid: String

An immutable system-assigned identifier of this SyncStreamJava.

Link copied to clipboard

Current subscription state.

Link copied to clipboard
abstract val uniqueName: String?

An optional unique name for this stream, assigned at creation time.

Functions

Link copied to clipboard
abstract override fun addListener(listener: SyncStreamJava.Listener)

Method to add listener for this SyncStreamJava.

Link copied to clipboard
abstract fun close()

Close this SyncStreamJava.

Link copied to clipboard

Publish a new message to this SyncStreamJava.

Link copied to clipboard
abstract override fun removeAllListeners()

Method to remove all listeners from this SyncStreamJava.

Link copied to clipboard
abstract override fun removeListener(listener: SyncStreamJava.Listener)

Method to Method to remove listener from this SyncStreamJava.

Link copied to clipboard

Remove this SyncStreamJava without opening it.

Link copied to clipboard
abstract fun setTtl(ttlSeconds: Long, callback: SuccessListener<SyncStreamJava>): CancellationToken

Set time to live for this SyncStreamJava.