ReadableStreamDefaultController.desiredSize
ReadableStreamDefaultController
接口的只读属性 desiredSize
返回填充满流的内部队列需要的大小。
值
一个整数。请注意,在队列已满的情况下,则可能是负数。
示例
规范中具有底层推送源和背压支持的流提供了一个很好的例子,说明如何使用 desiredSize
去手动检测流何时已满并应使用背压,以及使用 ReadablestreamDefaultController.error()
在流所依赖的系统一部分失效的情况去手动触发一个流错误。
规范
Specification |
---|
Streams # ref-for-rs-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.