Skip to content

Commit 0d984fd

Browse files
docs(generated): update checkpoints section with latestSequenceFrom
Generated SDK source code using: - Generator version 3.117.1 - Specification version 1.0.0-dev0.1.39 - Automation (cloudant-sdks) version fa24628
1 parent 2689b4a commit 0d984fd

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎docs/Changes_Follower.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [Error suppression](#error-suppression)
1111
- [Follower operation](#follower-operation)
1212
- [Checkpoints](#checkpoints)
13+
* [Checkpointing filtered changes](#checkpointing-filtered-changes)
1314
- [Code examples](#code-examples)
1415
* [Initializing a changes follower](#initializing-a-changes-follower)
1516
* [Starting the changes follower](#starting-the-changes-follower)
@@ -127,6 +128,24 @@ but the tradeoff is repeating more changes if it is necessary to resume the chan
127128
Take extreme care persisting sequences if choosing to process change items in parallel as there
128129
is a considerable risk of missing changes on a restart if the recorded sequence is out of order.
129130

131+
### Checkpointing filtered changes
132+
133+
With highly filtered changes feeds, multiple pages can pass through the follower without returning any
134+
change items. Using only the sequence ID of the last processed change item in those cases causes a long
135+
changes feed rewind on the next run.
136+
137+
To avoid this, periodically get the latest sequence from the follower.
138+
Supply the last fully processed sequence ID or a previously returned sequence value,
139+
and persist the returned value to use as the `since` parameter when restarting the follower.
140+
141+
```python
142+
latest_seq = changes_follower.latest_sequence_from(checkpoint_sequence_id)
143+
```
144+
145+
The follower retains a bounded window of recent sequence IDs. If subsequent page fetches displace
146+
the supplied sequence ID from that window, the follower returns the supplied value unchanged.
147+
Call and persist the result regularly to obtain a fresh sequence ID.
148+
130149
## Code examples
131150

132151
### Initializing a changes follower

0 commit comments

Comments
 (0)