ByteLengthQueuingStrategy
ByteLengthQueuingStrategy
はストリーム API のインターフェイスで、ストリームを構築するときに使用できる組み込みのバイト長キューイング戦略を提供します。
コンストラクター
ByteLengthQueuingStrategy()
-
新しい
ByteLengthQueuingStrategy
オブジェクトのインスタンスを作成します。
インスタンスプロパティ
ByteLengthQueuingStrategy.highWaterMark
読取専用-
背圧が適用される前に内部キューに格納することができるバイト数の合計。
インスタンスメソッド
ByteLengthQueuingStrategy.size()
-
指定されたチャンクの
byteLength
プロパティを返します。
例
js
const queueingStrategy = new ByteLengthQueuingStrategy({ highWaterMark: 1024 });
const readableStream = new ReadableStream(
{
start(controller) {
// …
},
pull(controller) {
// …
},
cancel(err) {
console.log("stream error:", err);
},
},
queueingStrategy,
);
const size = queueingStrategy.size(chunk);
仕様書
Specification |
---|
Streams # blqs-class |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ByteLengthQueuingStrategy | ||||||||||||||
ByteLengthQueuingStrategy() 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.