TREEcg / event-stream-client

Deprecated! Use the rdf-connect/ldes-client instead
https://github.com/rdf-connect/ldes-client
Other
14 stars 9 forks source link

Support back-pressure in createReadstream #25

Closed pietercolpaert closed 3 years ago

pietercolpaert commented 3 years ago

The _read function of the event stream is doing nothing. This means that the client will keep emitting and downloading members without waiting the sink to read from the stream. If the sink is slower than the LDES, this is going to make the sink overload.

Solution: make sure createReadstream function actually buffers and wait until the sink wants to read.