You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.
The following code simply increments number asynchronously 1000 times. I assumed the parallel transform emits a finish event after all data consumption but is didn't.
Basically, this is very hard unless using node >8, or comparable readable-stream, because that's when _final was added, and that fixes the problem of writable side thinking the transform is done before it should. The only difference is that you can use final as it is intended, instead of having to use end event or pump or something similar.
Since this module uses Node core stream instead of readable-stream, which is generally unrecommended, and is just a "modernised" and inheritance based version of parallel-transform I'll leave it as an exercise to someone else to port my pr mafintosh/parallel-transform#6 for this lib.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The following code simply increments number asynchronously 1000 times. I assumed the parallel transform emits a
finish
event after all data consumption but is didn't.This is not pleasant especially when we use libs such as
pump
that calls a callback function depending onfinish
event.It seems that it emits
finish
after all writable data is buffered instead of consumed.This problem occurs also in
parallel-stream
module.Also, when we do
readable.pipe(parallelTransform).pipe(writable)
, writable emitsfinish
earlier than expected.It is likely that we have to dig more in private methods of Node Stream.
The text was updated successfully, but these errors were encountered: