-
Notifications
You must be signed in to change notification settings - Fork 10
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
Disable highwater/lowwater feature #19
Comments
Looked into this once more and I am drawing the following preliminary conclusions:
Do these make any sense? |
I think you're right. In order to deal with high water marks the stream needs to be paused, otherwise the event queue will still fill, potentially until your system memory is exhausted. The documentation section about backpressure should give some context, but of course improvements or further clarifications are welcome: https://github.com/rolftimmermans/event-iterator#backpressure I do believe it should be possible to disable the warning by setting |
It is a consequence of how JavaScript works: function getKwargValue({ kwarg = 'value' } = {}) {
return kwarg;
}
getKwargValue() // => 'value'
getKwargValue({ kwarg: undefined }) // => 'value' |
I'm trying to use the library without setting any restrictions on buffer size (because if I set restrictions I will have to deal with buffers elsewhere in my code).
I've tried to read the source code (since the docs don't really mention this scenario) and it has left me with a few questions:
By default a high water mark of 100 items is set, but does this have any real consequences other than a console warning? I noticed that an
isPaused
flag is set, but then nothing is truly paused as new events will still be pushed to queue(?)What is the recommended approach for disabling the back pressure (including console warning) altogether? I've tried setting
highWaterMark
toundefined
but this won't override the default parameter value of 100. I figure I could implementhighWater
with an empty function, but that feels a bit hacky.Thanks for your work on this project and I hope you will find some time help me out a little bit. Cheers!
The text was updated successfully, but these errors were encountered: