Skip to content

BandwidthThrottle

Defined in: src/transfers/BandwidthThrottle.ts:21

Token-bucket throttle used to pace transfer chunks.

PropertyModifierTypeDescriptionDefined in
burstBytesreadonlynumberBurst capacity in bytes available before throttling kicks in.src/transfers/BandwidthThrottle.ts:25
bytesPerSecondreadonlynumberMaximum sustained transfer rate in bytes per second.src/transfers/BandwidthThrottle.ts:23
consume(bytes: number, signal?: AbortSignal): Promise<void>;

Defined in: src/transfers/BandwidthThrottle.ts:33

Consumes bytes from the bucket, awaiting refill when not enough tokens are available.

ParameterTypeDescription
bytesnumberNon-negative byte count being released by the throttle.
signal?AbortSignalOptional abort signal that interrupts pending waits.

Promise<void>

AbortError When the signal is aborted while waiting.