Class ReadIncrementalInstructionBase<TContent>
- Namespace
- LiveKit
Shared state and helpers for incremental stream reader yield instructions. Models the incoming stream as a single ordered queue whose items are either a chunk or a the end-of-stream marker (carrying an optional StreamError). The consumer advances through the queue one item at a time via Reset(); end-of-stream is only observed once every buffered chunk has been drained, mirroring the JS and Python SDKs. Subclasses own the typed event subscription and convert raw event payloads via OnChunk(TContent) and OnEos(StreamError).
public abstract class ReadIncrementalInstructionBase<TContent> : StreamYieldInstruction
Type Parameters
TContent
- Inheritance
-
ReadIncrementalInstructionBase<TContent>
- Derived
- Inherited Members
- Extension Methods
Constructors
ReadIncrementalInstructionBase(FfiHandle)
protected ReadIncrementalInstructionBase(FfiHandle readerHandle)
Parameters
readerHandleFfiHandle
Properties
Error
Error that occurred on the last read, if any.
public StreamError Error { get; }
Property Value
IsError
True if an error occurred on the last read.
public bool IsError { get; }
Property Value
Methods
MatchesHandle(ulong)
protected bool MatchesHandle(ulong eventHandle)
Parameters
eventHandleulong
Returns
OnChunk(TContent)
protected void OnChunk(TContent content)
Parameters
contentTContent
OnEos(StreamError)
protected void OnEos(StreamError protoError)
Parameters
protoErrorStreamError
Reset()
Resets the yield instruction for the next read.
public override void Reset()
Remarks
Calling this method after IsEos is true will throw an exception.