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
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
cancellationTokenCancellationTokenCancellation 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
cancellationTokenCancellationTokenCancellation token.
Returns
ReadAsync(CancellationToken)
Reads the next chunk of text.
public ValueTask<string?> ReadAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
Exceptions
- StreamException
The sender or the room went away before the stream was closed.