ByteLengthQueuingStrategy
Hinweis: Diese Funktion ist in Web Workers verfügbar.
Die ByteLengthQueuingStrategy
-Schnittstelle der Streams API bietet eine eingebaute Warteschlangestrategie basierend auf der Bytelänge, die beim Erstellen von Streams verwendet werden kann.
Konstruktor
ByteLengthQueuingStrategy()
-
Erstellt eine neue Instanz des
ByteLengthQueuingStrategy
-Objekts.
Instanz-Eigenschaften
ByteLengthQueuingStrategy.highWaterMark
Schreibgeschützt-
Die Gesamtzahl an Bytes, die in der internen Warteschlange enthalten sein können, bevor Backpressure angewendet wird.
Instanz-Methoden
ByteLengthQueuingStrategy.size()
-
Gibt die
byteLength
-Eigenschaft des gegebenen Chunks zurück.
Beispiele
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);
Spezifikationen
Specification |
---|
Streams # blqs-class |
Browser-Kompatibilität
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.