transferum
    Preparing search index...

    Class PendingResultQueue<T>

    Ordered result queue for parallel-then-emit patterns.

    Used by AsyncConvertTransfer and AsyncConditionTransfer when maxConcurrency > 1. Multiple async operations run in parallel, but their results are emitted to subscribers strictly in arrival order: a result with a higher sequence number waits in the queue until all lower-numbered results have been emitted.

    Mechanics:

    • nextSeq() — assigns a monotonically increasing sequence number
    • submit(seq, value) — stores a completed result
    • drain(handler) — emits all consecutively-numbered results starting from the expected sequence number
    • clear() — discards all pending results (used on destroy)

    Type Parameters

    • T
    Index
    • Discards all pending results and resets sequence counters.

      Returns void

    • Emits all consecutively-numbered results starting from the expected sequence number. Stops at the first gap (a not-yet-completed operation).

      Parameters

      • handler: (value: T) => void

      Returns void

    • Assigns the next sequence number for a new operation.

      Returns number

    • Stores a completed result indexed by its sequence number.

      Parameters

      • seq: number
      • value: T

      Returns void