Closed konklone closed 8 years ago
looks like your editor has some aggressive whitespace stuff turned on
also this looks good but honestly this module should just get rewritten to use require('through2')
and we'd get this for free
Yeah, my editor auto-kills trailing whitespace on save. https://github.com/maxogden/filereader-stream/pull/6/files?w=1 will view the diff without whitespace.
I'm not quite to the point of grokking through2 yet, though I've tried a few times tonight.
I just updated this PR with a tiny commit, dc4a320, that makes the reader emit pause
and resume
events when those events occur. Now that the stream supports backpressure management, those events are more frequent and more important.
Is this PR likely to be merged?
yes, just got lost in my inbox sorry
On Sunday, November 1, 2015, Eric Mill notifications@github.com wrote:
Is this PR likely to be merged?
— Reply to this email directly or view it on GitHub https://github.com/maxogden/filereader-stream/pull/6#issuecomment-152841513 .
Sent from my phone
@konklone I ended up rewriting the module. 1.0.0 is out now
This updates
filereader-stream
to listen to backpressure suggestions from downstream.This is my first meaningful stream work, and I'm prepared to be told I've done something silly. But it seems to work in empirical testing. Without this patch, filereader-stream has no way to be told to stop reading a very large file into memory.
I haven't included a test, mostly because I think it would take me a long time to figure out how to create an anonymous write stream that establishes a high watermark. Maybe it's simpler than I think? Suggestions welcome.