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 GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
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.

関連情報