CountQueuingStrategy: size() メソッド
size()
は CountQueuingStrategy
インターフェイスのメソッドで、常に 1
を返します。従って、合計キューサイズはキュー内のチャンク数を数えたものになります。
構文
js
size()
引数
なし。
返値
1
。
例
js
const queuingStrategy = new CountQueuingStrategy({ highWaterMark: 1 });
const writableStream = new WritableStream(
{
// シンクの実装
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.
関連情報
CountQueuingStrategy()
コンストラクター