Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2022年6月.
desiredSize は TransformStreamDefaultController インターフェイスの読み取り専用プロパティで、関連付けられた ReadableStream のキューを埋めるのに必要なサイズを返します。
ReadableStream の内部キューには、キューに入れられたがまだ読み込まれていないチャンクが格納されます。ブラウザーはストリームを埋めるために 必要なサイズ を決定し、この値が desiredSize プロパティによって返されます。
もし desiredSize が 0 ならば、キューは満杯です。従って、この情報を使用して手動で背圧をかけることでキューを管理することができます。
必要なサイズ。
次の例では、 desiredSize をコンソールに出力します。
| Streams # ts-default-controller-desired-size |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2023年9月28日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.