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

    Interface BranchGroup<V>

    Fixed endpoints sharing one lazy source execution and its cleanup. The group owns the source iterator exclusively. All endpoints participate from construction, including unread ones. Stopping before demand never acquires the source. When the last endpoint leaves, the source stops; a failed or cancelled last endpoint cancels it with that reason. Termination is idempotent.

    interface BranchGroup<V> {
        branches: Branches<V>;
        closed: Promise<BranchGroupCloseReport<V>>;
        cancel(reason?: unknown): void;
        close(): Promise<BranchGroupCloseReport<V>>;
    }

    Type Parameters

    • V
    Index
    branches: Branches<V>
    closed: Promise<BranchGroupCloseReport<V>>

    Waits for every endpoint, outstanding source work and routing callbacks, and shared cleanup. Never rejects; inspect report.source even when downstream consumers succeed. Downstream callbacks and finalizers belong to their consumers and must be awaited separately. Does not initiate a stop. Unread queues or work that ignores cancellation can keep it pending while detached endpoints finish earlier. Never await it from a source finalizer, since the group waits for that finalizer.

    • Cancels all endpoints before shared cleanup, aborting source work and routing callbacks.

      Parameters

      • Optionalreason: unknown

      Returns void