This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The CountQueuingStrategy interface of the the Streams API provides a built-in byte length queuing strategy that can be used when constructing streams.
Constructor
CountQueuingStrategy()
- Creates a new
CountQueuingStrategy
object instance.
Properties
None.
Methods
CountQueuingStrategy.size()
- Returns
1
.
Examples
const queuingStrategy = new CountQueuingStrategy({ highWaterMark: 1 });
const writableStream = new WritableStream({
// Implement the sink
write(chunk) {
...
},
close() {
...
},
abort(err) {
console.log("Sink error:", err);
}
}, queuingStrategy);
var size = queuingStrategy.size()
;
Specifications
Specification | Status | Comment |
---|---|---|
Streams The definition of 'CountQueuingStrategy' in that specification. |
Living Standard | Initial definition. |
Browser Compatibility
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | 58 | (Yes) | No support | ? | 45 | ? |
Feature | Android Webview | Chrome for Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support | 58 | 58 | (Yes) | No support | ? | 45 | ? |