throttleByteIterable
function throttleByteIterable( source: AsyncIterable<Uint8Array<ArrayBufferLike>>, throttle: | BandwidthThrottle | undefined,signal?: AbortSignal): AsyncIterable<Uint8Array<ArrayBufferLike>>;Defined in: src/transfers/BandwidthThrottle.ts:125
Wraps an async iterable of byte chunks so each chunk is released only after the throttle has admitted its byte count.
When throttle is undefined, the source iterable is returned unchanged.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
source | AsyncIterable<Uint8Array<ArrayBufferLike>> | Async iterable that produces byte chunks. |
throttle | | BandwidthThrottle | undefined | Optional throttle that paces chunk emission. |
signal? | AbortSignal | Optional abort signal interrupting pending waits. |
Returns
Section titled “Returns”AsyncIterable<Uint8Array<ArrayBufferLike>>
Async generator emitting the original chunks at the throttled rate.