Skip to content

Commit 660c0a2

Browse files
Document backpressure options on read and subscription (#345)
Co-authored-by: William Chong <william-chong@outlook.com>
1 parent 80a3bd0 commit 660c0a2

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

docs/api/reading-events.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,4 +385,17 @@ publisher.subscribe(new Subscriber<ReadMessage>() {
385385

386386
latch.await();
387387
```
388-
:::
388+
:::
389+
390+
## Configuring Backpressure
391+
392+
The client allows you to configure backpressure to control how many events are buffered on the client side before requesting more from the server.
393+
394+
| Option | Description | Default Value |
395+
|----------------|-----------------------------------------------------------------------------|---------------|
396+
| batchSize | The maximum number of events the client will request from the server in a single batch. | 512 |
397+
| thresholdRatio | The fraction of the `batchSize` at which the client will send a new request for more events. | 0.25 |
398+
399+
By default, the client requests up to 512 events at a time. It will automatically
400+
request more events when the number of buffered (unprocessed) events falls below
401+
25% of the batch size.

docs/api/subscriptions.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,3 +406,16 @@ For example:
406406
- If `n` = 2, the notification is sent every 64 events.
407407
- If `n` = 3, it is sent every 96 events, and so on.
408408
:::
409+
410+
## Configuring Backpressure
411+
412+
The client allows you to configure backpressure to control how many events are buffered on the client side before requesting more from the server.
413+
414+
| Option | Description | Default Value |
415+
|----------------|-----------------------------------------------------------------------------|---------------|
416+
| batchSize | The maximum number of events the client will request from the server in a single batch. | 512 |
417+
| thresholdRatio | The fraction of the `batchSize` at which the client will send a new request for more events. | 0.25 |
418+
419+
By default, the client requests up to 512 events at a time. It will automatically
420+
request more events when the number of buffered (unprocessed) events falls below
421+
25% of the batch size.

0 commit comments

Comments
 (0)