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

    Function bufferTime

    • Collects values into non-empty arrays, flushing when maxItems is reached or windowMs milliseconds have elapsed since the batch's first item arrived.

      On normal completion, any remaining buffered items are emitted as a final batch. At most one upstream read remains pending when a window flushes, so batches do not accumulate in the background while downstream is idle.

      Parameters

      Returns <T>(source: AsyncIterable<T>) => Stream<T[]>

      If windowMs is not finite and positive, or maxItems is not a positive safe integer.

    • Collects values into non-empty arrays, flushing when maxItems is reached or windowMs milliseconds have elapsed since the batch's first item arrived.

      On normal completion, any remaining buffered items are emitted as a final batch. At most one upstream read remains pending when a window flushes, so batches do not accumulate in the background while downstream is idle.

      Type Parameters

      • T

      Parameters

      Returns Operator<T, T[]>

      If windowMs is not finite and positive, or maxItems is not a positive safe integer.