Baseline Widely available
Note: This feature is available in Web Workers.
The desiredSize
read-only property of the TransformStreamDefaultController
interface returns the desired size to fill the queue of the associated ReadableStream
.
The internal queue of a ReadableStream
contains chunks that have been enqueued, but not yet read. The browser determines the desired size to fill the stream, and it is this value returned by the desiredSize
property.
If the desiredSize
is 0
then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue.
The desired size.
ExamplesIn the next example the desiredSize
is logged to the console.
console.log(controller.desiredSize);
Specifications Browser compatibility
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4