Skip to content
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

Proper pause/resume support on Streams #384

Closed
wolf4ood opened this issue Aug 9, 2019 · 0 comments
Closed

Proper pause/resume support on Streams #384

wolf4ood opened this issue Aug 9, 2019 · 0 comments
Assignees
Milestone

Comments

@wolf4ood
Copy link
Member

wolf4ood commented Aug 9, 2019

From OrientJS v.3 the returns of a query is a NodeJS streams, in order to support the new pagination feature of OrientDB 3.0.x. So it is possible to pause a stream and resume it later in time.

let stream = session
        .query("select from OUser", {
          pageSize: 1
        })

stream.on("data",console.log);

stream.pause();

setTimeout(()=> {
   stream.resume();
},1000)

This works fine, but still OrientJS, will request for the next page, if available, even if the stream is paused, that can result in high memory footprint due the records being cached in the stream buffer while the stream is in paused state.

OrientJS should not ask for the next page if the stream is paused.

@wolf4ood wolf4ood self-assigned this Aug 9, 2019
@wolf4ood wolf4ood added this to the 3.0.6 milestone Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant