-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
51 lines (37 loc) · 1.11 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
title: "CountQueuingStrategy: highWaterMark property"
short-title: highWaterMark
slug: Web/API/CountQueuingStrategy/highWaterMark
page-type: web-api-instance-property
browser-compat: api.CountQueuingStrategy.highWaterMark
---
{{APIRef("Streams")}}{{AvailableInWorkers}}
The read-only **`CountQueuingStrategy.highWaterMark`** property returns the total number of chunks that can be contained in the internal queue before backpressure is applied.
## Values
An integer representing a number of chunks.
## Examples
```js
const queueingStrategy = new CountQueuingStrategy({ highWaterMark: 1 });
const readableStream = new ReadableStream(
{
start(controller) {
// …
},
pull(controller) {
// …
},
cancel(err) {
console.log("stream error:", err);
},
},
queuingStrategy,
);
const size = queuingStrategy.size(chunk);
console.log(`highWaterMark value: ${queuingStrategy.highWaterMark}$`);
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("CountQueuingStrategy.CountQueuingStrategy", "CountQueuingStrategy()")}} constructor