Closed liran closed 3 years ago
@liran, thanks for the feedback! I don't know about "backpressure" or the "drain" event. I will inform myself and come back to you when I have something.
If the receiver adjusts the speed of receiving data through pause()
and resume()
, the corresponding sender also needs to slow down the data writing speed.
Through the drain
event, the sender can control the write speed.
Therefore, when implementing pause()
and resume()
for the receiver in #41, the drain
event should also be implemented for the sender.
@liran, I will add a drain
event when socket.pause()
and socket.resume()
are implemented. In the meantime, a hacky workaround might be using the callback argument provided to socket.write()
and a little extra code logic.
@Rapsssito Thank you for your efforts.
:tada: This issue has been resolved in version 5.3.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
When writing a large file, if we don't have a drain event, how do we handle backpressure? about drain : https://nodejs.org/api/stream.html#stream_event_drain