desiredSize
只读特性在
ReadableStreamDefaultController
interface returns the desired size required to fill the stream's internal queue.
var desiredSize = readableStreamDefaultController.desiredSize;
An integer. Note that this can be negative if the queue is over-full.
A readable stream with an underlying push source and backpressure support
example in the spec provides a good example of using
desiredSize
to manually detect when the stream is full and apply backpressure, and also of using
ReadablestreamDefaultController.error()
to manually trigger a stream error if another part of the system it relies on fails.
| 规范 | 状态 | 注释 |
|---|---|---|
|
流
The definition of 'desiredSize' in that specification. |
实时标准 | 初始定义。 |
The compatibility table in 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.
更新 GitHub 上的兼容性数据| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
desiredSize
|
Chrome ? | Edge ? |
Firefox
65
|
IE ? | Opera ? | Safari ? | WebView Android ? | Chrome Android ? |
Firefox Android
65
|
Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
完整支持
兼容性未知
实验。期望将来行为有所改变。
用户必须明确启用此特征。
ReadableStreamDefaultController
desiredSize