Skip to content

PieceBatcherWait

PieceBatcherWait = { kind: "delay"; ms: number; } | { kind: "limiter"; }

Defined in: packages/synapse-core/src/sp/create-piece-batcher.ts:59

When to flush a tumbling addPieces window (limiter overflow, flush(), and close() always flush regardless).

  • delay: wait ms once the window has a piece and no upload/pull is still parking (ms: 0 is one macrotask). New parking work restarts the delay.
  • limiter: no timer; sit until the next piece does not fit, or flush/close.