CountQueuingStrategy: size()-Methode
Hinweis: Diese Funktion ist in Web Workers verfügbar.
Die size()
-Methode des
CountQueuingStrategy
-Interfaces gibt immer 1
zurück, sodass die
gesamte Warteschlangengröße die Anzahl der Chunks in der Warteschlange darstellt.
Syntax
js
size()
Parameter
Keine.
Rückgabewert
1
.
Beispiele
js
const queuingStrategy = new CountQueuingStrategy({ highWaterMark: 1 });
const writableStream = new WritableStream(
{
// Implement the sink
write(chunk) {
// …
},
close() {
// …
},
abort(err) {
console.log("Sink error:", err);
},
},
queuingStrategy,
);
const size = queuingStrategy.size();
Spezifikationen
Specification |
---|
Streams # ref-for-cqs-size② |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
size |
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.
Siehe auch
CountQueuingStrategy()
-Konstruktor