TransformStreamDefaultController.desiredSize
Invalid slug for templ/sidebar: Streams API
TransformStreamDefaultController
接口的只读属性 desiredSize
返回填充满关联的 ReadableStream
的内部队列所需要的大小。
ReadableStream
的内部队列包含已入队但尚未读取的分块。浏览器确定填满流所需要的大小,并且这个值由 desiredSize
属性返回。
如果这个 desiredSize
是 0
,则队列已满。因此你可以使用这个信息去手动管理背压去管理队列。
值
所需的大小。
示例
在下面的示例中,desiredSize
被打印到控制台。
js
console.log(controller.desiredSize);
规范
Specification |
---|
Streams # ts-default-controller-desired-size |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
desiredSize |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.