Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change implementation of the Concatenator to make it look like more a stream #83

Open
julienw opened this issue Jun 4, 2020 · 0 comments

Comments

@julienw
Copy link
Contributor

julienw commented Jun 4, 2020

The Concatenator works by keeping all chunks in an array, and concatenating them all when the stream is ended. Then we keep and return this result when transferContents is called. The result is also cleared when the stream is destroy.

Node v14 now autodestroys stream by default when it ends.
The easy option is to force autoDestroy to true in the constructor.
A better option could be to output the result at the end like a stream, simply pushing the result of the concatenation. Possibly we would need to use objectMode for this too, so that node handles this result as one object instead of a big chunk. This would make the object more true to how streams work, and in the end more compatible with this mechanism in the long run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant