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

Add option to not implicitly end when there is nothing to read() #46

Open
kanongil opened this issue Sep 27, 2017 · 0 comments
Open

Add option to not implicitly end when there is nothing to read() #46

kanongil opened this issue Sep 27, 2017 · 0 comments

Comments

@kanongil
Copy link

I have a use case, where I create a BufferList that is piped to a processor.

I want to be able to setup the bl.pipe(processor) before I even start to feed data into the bufferlist. When I try that, the bufferlist immediately ends.

Failing example:

const Stream = require('stream');
const BufferList = require('bl');

const bl = new BufferList();
const processor = new BufferList((err, buffer) => {    // Can be any writable

    console.log('result:', buffer.toString());
});

bl.pipe(processor);

setImmediate(() => {

    bl.append('hello');
    bl.end();
});
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

No branches or pull requests

1 participant