-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
estuary-cdk: FetchPageFn is also an AsyncGenerator
Much like FetchChangesFn, FetchPageFn is now an AsyncGenerator which yields documents, checkpoint-able PageCursors, or completes an iteration of a resource. This refactoring is consistent with recent updates to FetchChangesFn, and is motivated by use cases where the fetched "page" could be quite large and itself composed of multiple concurrent data fetches, implemented as constituent AsyncGenerator instances. By using an AsyncGenerator, such an implementation can immediately yield from across those concurrent fetches as data arrives such that data is spilled to disk and memory pressure kept low. Then, when the scatter / gather data fetch completes, the entire "page" is checkpointed.
- Loading branch information
1 parent
e1be996
commit ee34ea7
Showing
2 changed files
with
47 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters