TransformStreamDefaultController: desiredSize プロパティ
Invalid slug for templ/sidebar: Streams API
desiredSize
は TransformStreamDefaultController
インターフェイスの読み取り専用プロパティで、関連付けられた ReadableStream
のキューを埋めるのに必要なサイズを返します。
ReadableStream
の内部キューには、キューに入れられたがまだ読み込まれていないチャンクが格納されます。ブラウザーはストリームを埋めるために 必要なサイズ を決定し、この値が desiredSize
プロパティによって返されます。
もし desiredSize
が 0
ならば、キューは満杯です。従って、この情報を使用して手動で背圧をかけることでキューを管理することができます。
値
必要なサイズ。
例
次の例では、 desiredSize
をコンソールに出力します。
js
console.log(controller.desiredSize);
仕様書
Specification |
---|
Streams # ts-default-controller-desired-size |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
desiredSize |
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.