CountQueuingStrategy.size()
CountQueuingStrategy
接口的 size()
方法始终返回 1
,因此队列的总大小是队列中所有分块的数量。
语法
js
size()
参数
无。
返回值
1
。
示例
js
const queuingStrategy = new CountQueuingStrategy({ highWaterMark: 1 });
const writableStream = new WritableStream(
{
// Implement the sink
write(chunk) {
// …
},
close() {
// …
},
abort(err) {
console.log("Sink error:", err);
},
},
queuingStrategy,
);
const size = queuingStrategy.size();
规范
Specification |
---|
Streams # ref-for-cqs-size② |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
size |
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.