CountQueuingStrategy
CountQueuingStrategy
はストリーム API のインターフェイスで、ストリームの構築時に使用できる組み込みのチャンクカウントキューイング戦略を提供します。
コンストラクター
CountQueuingStrategy()
-
新しい
CountQueuingStrategy
オブジェクトのインスタンスを作成します。
インスタンスプロパティ
CountQueuingStrategy.highWaterMark
読取専用-
背圧が適用される前の内部キューに含まれているチャンクの総数です。
インスタンスメソッド
CountQueuingStrategy.size()
-
常に
1
を返します。
例
js
const queueingStrategy = new CountQueuingStrategy({ highWaterMark: 1 });
const writableStream = new WritableStream(
{
// シンクの実装
write(chunk) {
// …
},
close() {
// …
},
abort(err) {
console.log("Sink error:", err);
},
},
queueingStrategy,
);
const size = queueingStrategy.size();
仕様書
Specification |
---|
Streams # cqs-class |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CountQueuingStrategy | ||||||||||||||
CountQueuingStrategy() constructor | ||||||||||||||
highWaterMark | ||||||||||||||
size |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- Has more compatibility info.
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.