-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): allow to pause/resume query result observers #588
Conversation
f37a49c
to
ba10b46
Compare
Codecov ReportBase: 100.00% // Head: 100.00% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #588 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 33 33
Lines 1273 1333 +60
Branches 306 323 +17
=========================================
+ Hits 1273 1333 +60
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
What do you think about add new example which with pause/resume behaviour?
The ultimate goal is to switch to reading query results from an async iterable (in a simple |
This PR allows pausing query results by returning
false
in thenext
callback ofqueryApi.queryLines
andqueryApi.queryRows
consumer. The consumer must defineuseResume
callback that receives a function that resumes receiving data when called. This feature adds a low-level (node.js stream) style of lossless backpressure to query result processing via communication observer.Method signatures changed, the
next
callback ofCommunicationObserver
andFluxResultObserver
can newly return also a boolean value,false
value will stop processing. All these changes are backward compatible, no change is required for the existing code.Checklist
yarn test
completes successfully