Parser stops consuming lines if stdin is slow
Closed this issue · 3 comments
epoberezkin commented
Running
something_slow | tap-parser --lines
consistently stops consuming lines somewhere mid-way after couple of thousands lines.
This always works ok:
something_slow > temp.txt
cat temp.txt | tap-parser --lines
@isaacs any idea how to investigate would be helpful.
epoberezkin commented
Ok, so it is caused by calling process.exit(0)
in the app that produces tap output.
With and without process.exit(0)
this works correctly:
node app > tap.txt
cat tap.txt | tap-parser --lines
Piping only works without process.exit():
node app | tap-parser --lines
I don't think it's the issue of this package, but maybe somebody knows why?
epoberezkin commented
Seems related: nodejs/node#9633
epoberezkin commented
ok, so process.exit kills output and writing to file works because it is faster.