http://www.hacksparrow.com/difference-between-spawn-and-exec-of-node-js-child_process.html
Difference between spawn and exec of Node.js child_process
"""...
The most significant difference between child_process.spawn and child_process.exec is
in what they return -
spawn returns a stream and
exec returns a buffer.
... child_process.spawn is "asynchronously asynchronous",
meaning it starts sending back data ... as soon as the child process starts executing
...
child_process.exec returns the whole buffer output from the child process.
By default the buffer size is set at 200k.
If the child process returns anything more than that, your program will
crash with the error message "Error: maxBuffer exceeded".
... child_process.exec is "synchronously asynchronous", ...
it waits for the child process to end and tries to return all the buffered data at once
..."""
2015年7月8日 星期三
nodejs fork, spawn, exec
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言