dominictarr / split

MIT License
347 stars 39 forks source link

Is the stream expected to continue if the buffer is exceeded? #27

Closed rauchg closed 6 years ago

rauchg commented 6 years ago

https://github.com/dominictarr/split/blob/master/index.js#L45

There's no return after the error is emitted. Is this by design?

rauchg commented 6 years ago

FWIW, for others who might arrive to this issue: switching to split2 by @mcollina addresses my concern (it returns if max buffer is reached).

In addition, @mcollina's has the subtle difference of also applying the maxLength policy to any write, not just buffered writes, which I think is a good decision.

mcollina commented 6 years ago

Thanks @rauchg. split2 is based on Streams3, and most of these things come "for free", because of that. I would also want to note that split2 fully respects utf-8 boundaries.

split2 is unfortunately slower than split. However I haven't seen it having a big impact in real-life situations. If you care about speed you can try http://npm.im/syncsplit.

dominictarr commented 6 years ago

@rauchg you are right, this should return there.

dominictarr commented 6 years ago

fixed in 1.0.1

BurtHarris commented 6 years ago

Should this issue be closed now? The other two open issues look resolved to me too.