is there a way to lower the highWaterMark for stdout when doing a child_process.spawn?
i read that there might be a way to to lower it for exec, but i actually need to start a process to which i can pass data via stdin and read out the result via stdout.
the highWaterMark is set to high resulting in unacceptable delays for reading the stdout.
i have tried to pass stream objects to the spawn link this:
avconv = spawn("avconv", params, {
stdio: [process.stdin, process.stdout, process.stderr]
});
which works fine, but when i try to create my own stream for witch i could define a custom highWaterMark:
var readable = new stream.Readable();
avconv = spawn("avconv", params, {
stdio: [process.stdin, readable, process.stderr]
});
node wont accept it. resulting in a type error.
I was able to lower the buffers of the child stdio streams by setting these:
child.stdin._writableState.highWaterMark
child.stdout._readableState.highWaterMark
But there appears to be other buffering done by the process so lowering these may or may not help much.
The docs say streams passed into the stdio option must have an underlying file descriptor such as those attached to a file or socket.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With