Open jbaudanza opened 3 years ago
I think you are doing it correctly? It's just a node stream thing. From nodejs docs:
Passing chunk as null signals the end of the stream (EOF) and behaves the same as readable.push(null), after which no more data can be written. The EOF signal is put at the end of the buffer and any buffered data will still be flushed.
Also, Looks like this is what node does internally if you call readable.destroy()
I'm having an issue where sometimes my node process won't exit, even after calling
process.exit
.The reason is that node won't execute if there are still outstanding async tasks in its thread pool. I tracked the outstanding task down to the
readExecute
call in governor.cc.Here is a simple program to illustrate the problem:
The workaround I've found it to force muxerStream to emit an "end" event by pushing "null". This triggers an event handler in beamstreams.js that calls
governor.finish()
. There is probably a better way.This is never an issue when the muxes is allowed to run to completion. However, often times error cases mean I need to abort the process early. In this case, I need a clean way to shut down the governor queue.