-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Implement stream backpressure #323
Comments
When the pause event is sent, MetacomWritable start pausing sending data and waiting for the resume event. All this time data piped to the MetacomWritable should be stored into MetacomWritable's internal buffer or MetacomWritable.write should return false and when resumed emitting drain event? |
Readable should pause writable if it's internal queue is being emptied too slowly, what leads to stream overflow. The main goal of this mechanism is to prevent such overflow, so the data between pause and resume is collected in the readable's internal queue. |
That's clear. I am about another. We have the following flow: readable.pipe(MetacomWritable)->(Metacom)->(MetacomReadable). |
@pgnedoy |
The task
Metacom streaming consists of data source on one end and reader on another. These endpoints are independent in sense of data stream speed. It means the stream overflow is possible. To prevent the case when the data source produces chunks too fast for reader's consumption capability we can implement backpressure control over the stream.
How to implement
Create a PR to branch streams
The text was updated successfully, but these errors were encountered: