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
Error: stream.push() after EOF #207
Comments
ok...this is likely an issue with something using readable stream that ended the stream and then wrote more to it |
Closing for no activity. |
I believe you should reopen this case.
where
|
If I'm reading your example right that isn't an issue with streams as much as a bug in the userland code |
Why? It's a little bit short as an answer... Why do you think |
Is the example given in chapter 5 |
When you say 'ok...this is likely an issue with something using readable stream that ended the stream and then wrote more to it' does it mean this _flush method is useless? |
And last question: why this code does not trigger any exception?
|
|
This code works fine:
the test is here:
but if I change the I commented |
should be
and there is an extra both versions work for me once I fix those things (the version with the other regex does work but it just wraps the whole thing in a single also you can simplify your transform into let data = chunk.toString();
this.rest += data;
[this.toPush, this.rest] = this.f(this.rest);
for (let thing of this.toPush) {
this.push(thing);
}
console.log("*********"+this.rest);
done() |
Thanks, but it does not help. I'm on a Mac and I do not have the LF, CR problem, but I made the changes to see, and I got the same exception (BTW I do not understand why you think some syntactic sugar can have any incidence on the expected result). Maybe it's a Mac specific problem, on what kind of machine did you test the code? |
I'm on a mac too so it may have been just due to where I downloaded the stuff from for (let i = 0; i < this.toPush.length; i++) {
//console.log("Try to push "+this.toPush[i]);
if (!this.push(this.toPush[i])) {
//this._source.readStop();
break;
} else {
//console.log(this.toPush[i]+" pushed");
}
} might have slightly different semantics then for (let thing of this.toPush) {
this.push(thing);
} in certain circumstances. the example had 2 calls to super, I removed one are you running this in a browser or node? and what version of node if it's in node |
Yes, I have that file from so long I forgot when I cleant it and I should have thought i'm not alone on earth...
Do you know a way to bypass this use of _flush and test eof inside _transform or _read of a readable stream? I feel like we are not going to solve this problem any time soon and I would like to use stream. Thank you very much for you help, and forgive my tone, you have excited my susceptibility :( |
on node 8 you can use _final instead of _flush which is similar but the writable side will not close until done in it |
Thanks Calvin, you are great! If it happens you come to Paris I invite you to a good restaurant :) |
just delete doc.end(); |
A heads up.
The text was updated successfully, but these errors were encountered: