Table of Contents

Class TextStreamReader

Namespace
LiveKit.Rtc
Assembly
LivekitRtc.dll

Reader for text data streams. Implements IAsyncEnumerable for modern async iteration patterns.

public class TextStreamReader : IAsyncDisposable, IDisposable, IAsyncEnumerable<string>
Inheritance
TextStreamReader
Implements
Inherited Members

Properties

Info

Gets the stream info.

public TextStreamInfo Info { get; }

Property Value

TextStreamInfo

Methods

Dispose()

Stops receiving: the chunks already received can still be read, then reads return null. Later chunks are dropped.

public void Dispose()

DisposeAsync()

Stops receiving: the chunks already received can still be read, then reads return null. Later chunks are dropped.

public ValueTask DisposeAsync()

Returns

ValueTask

A completed task.

GetAsyncEnumerator(CancellationToken)

Returns an async enumerator for iterating over text chunks.

public IAsyncEnumerator<string> GetAsyncEnumerator(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

IAsyncEnumerator<string>

An async enumerator of text chunks.

ReadAllAsync(CancellationToken)

Reads all remaining text from the stream.

public ValueTask<string> ReadAllAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

ValueTask<string>

The complete text content.

ReadAsync(CancellationToken)

Reads the next chunk of text.

public ValueTask<string?> ReadAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

ValueTask<string>

The next text chunk, or null if the stream is complete.

Exceptions

StreamException

The sender or the room went away before the stream was closed.