Creates a new ProcessMonitor.
Callack for termination
Callback for stdout and stderr events
Closes the monitor's end of stdin for the process.
Sends a signal to the process.
Sends a line of input to the monitored process's stdin.
Start a monitored process given the arguments (args), environment (env) and working directory (workingDir).
Block on the current fibre until the process has exited.
The time to wait before the process is force-killed by the monitor after being asked to stop. Defaults to 20 seconds.
Returns the pid of the running process, or the last process run. Otherwise returns Pid.init.
Returns whether or not the monitored process is currently running.
Sets the callback for when a line from the monitored process's stderr is read.
Sets the callback for when a line from the monitored process's stdout is read.
Sets the callback for when the monitored process exits.
Spawns and monitors sub-processes.
Monitoring processes in a safe way is expensive. This implementation requires spawning 3 threads per process. Use this sparingly.
This class is entirely thread and fibre safe. Methods that block only block on the fibre (not the thread), and locks are used to prevent data-races.