TextStreamReceiver

Receiver for an incoming text stream.

Chunks are decoded as UTF-8 strings. Provided to TextStreamHandler callbacks registered through Room.

See also

Room.registerTextStreamHandler

Constructors

Link copied to clipboard
constructor(info: TextStreamInfo, source: Channel<ByteArray>)

Properties

Link copied to clipboard
open override val flow: Flow<String>

A Flow of stream data as it arrives.

Link copied to clipboard

Metadata for this stream.

Functions

Link copied to clipboard
suspend fun readAll(): List<String>

Suspends and waits for all available data until the stream is closed.

Link copied to clipboard
suspend fun readNext(): String

Suspends and waits for the next piece of data.