Streams

interface Streams

Functions

Link copied to clipboard
abstract suspend fun create(uniqueName: String? = null, ttl: <Error class: unknown class> = Duration.INFINITE): SyncStream

Create new SyncStream object.

Link copied to clipboard
abstract suspend fun openExisting(sidOrUniqueName: String): SyncStream

Open existing SyncStream by SID or unique name.

Link copied to clipboard
abstract suspend fun openOrCreate(uniqueName: String, ttl: <Error class: unknown class> = Duration.INFINITE): SyncStream

Open existing SyncStream by unique name or create a new one if specified name does not exist.

Link copied to clipboard
abstract suspend fun publishMessage(sidOrUniqueName: String, data: <Error class: unknown class>): SyncStream.Message

Publish a new message to SyncStream without opening it.

Link copied to clipboard
inline suspend fun <T : Any> Streams.publishMessage(sidOrUniqueName: String, data: T): SyncStream.Message

Serializes the given value into an equivalent JsonObject using a serializer retrieved from reified type parameter and publish it as a new message to this SyncStream without opening it.

Link copied to clipboard
abstract suspend fun remove(sidOrUniqueName: String)

Remove SyncStream without opening it.

Link copied to clipboard
abstract suspend fun setTtl(sidOrUniqueName: String, ttl: <Error class: unknown class>)

Set time to live for SyncStream without opening it.