mogami-stream - v0.4.0
    Preparing search index...

    Interface Branch<T>

    A bounded endpoint that permits one iterator acquisition and one pending next(). Derived streams consume the same endpoint; wrapping a branch does not make it reusable.

    interface Branch<T> {
        closed: Promise<CloseReport>;
        "[asyncIterator]"(): StreamIterator<T>;
        cancel(reason?: unknown): void;
        detach(): void;
        iterate(options?: ExecutionOptions): StreamIterator<T>;
    }

    Type Parameters

    • T

    Hierarchy

    • AsyncIterable<T>
      • Branch
    Index
    closed: Promise<CloseReport>

    Endpoint completion, independent of siblings, downstream callbacks, and shared cleanup. At EOF, the queue drains before completion. Shared failures discard active queues and fail remaining endpoints without changing already completed reports.

    • Cancels this branch. Its pending or next read rejects once; later reads return done.

      Parameters

      • Optionalreason: unknown

      Returns void

    • Discards unread values immediately, without waiting for siblings or shared cleanup.

      Returns void

    • Acquires this branch once; a second acquisition throws TypeError. Overlapping next() calls reject with TypeError. The signal cancels only this branch. Iterator return() or a for await break detaches immediately; iterator throw(error) fails only this endpoint without forwarding throw to the source. Its closed is this branch's report; neither return() nor closed waits for shared cleanup.

      Parameters

      Returns StreamIterator<T>