supervised.monitor

Implements ProcessMonitor.

Publicly imports ProcessException from std.process.

Members

Aliases

ProcessException
alias ProcessException = std.process.ProcessException

Exception thrown by spawnProcess when ProcessMonitor.start is called

Classes

InvalidStateException
class InvalidStateException

Exception thrown when a method is called on a ProcessMonitor during invalid state.

ProcessMonitor
class ProcessMonitor

Spawns and monitors sub-processes.

Examples

1 auto monitor = new shared ProcessMonitor;
2 monitor.stdoutCallback = (string line) {
3    writeln(line);
4 }
5 monitor.terminateCallback = () {
6    writeln("terminated");
7 }
8 
9 monitor.start(["cat"]);
10 
11 monitor.send("foo");
12 monitor.send("bar");
13 monitor.closeStdin();
14 
15 assert(monitor.wait() == 0);

Meta