LimitedStream

Inheritors

Properties

Link copied to clipboard
abstract val id: StreamId

Functions

Link copied to clipboard
abstract suspend fun broadcast(text: String, filter: (StreamId) -> Boolean = { true })

Send a text message to all clients connected on this stream.

Link copied to clipboard
suspend fun LimitedStream.broadcastExcluding(text: String, streamId: StreamId)
suspend fun LimitedStream.broadcastExcluding(text: String, streamIds: Iterable<StreamId>)

Convenience method to send a message to all clients that don't match any of the passed in IDs.

Link copied to clipboard
suspend fun LimitedStream.sendTo(text: String, streamId: StreamId)

suspend fun LimitedStream.sendTo(text: String, streamIds: Iterable<StreamId>)

Convenience method to send a message to all clients with matching IDs.