Web APIs

CountQueuingStrategy()

Try the free JavaScript compiler

Use a queuing strategy that counts chunks equally, regardless of their byte size. The high-water mark is a backpressure threshold, not a hard memory bound. Example console output: 3 1.

Formal Syntax & Structure

javascript syntaxjavascript
new CountQueuingStrategy({highWaterMark})

Parameters & Attributes

NameTypeDescription
optionsobjectRequired highWaterMark number.

Return Value

CountQueuingStrategy

Chunk-count strategy.

Working Example

Example Snippetjavascript
const strategy=new CountQueuingStrategy({highWaterMark:3}); console.log(strategy.highWaterMark,strategy.size(new Uint8Array(20)));
JavaScript Reference