Skip to content

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

@julienw

Description

@julienw

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions