Example:
auto monitor = monitorProcess(1234, (event) {
writeln("Event: ", event.type, " for PID ", event.pid);
});
// ... later ...
monitor.stop();ProcessMonitor monitorProcess(int pid, ProcessCallback callback,
Duration interval = 100.msecs) @safeConvenience function to monitor a single process.
pid | Process ID to monitor. |
callback | Function to call on process events. |
interval | Monitoring interval. |
Example:
auto monitor = monitorProcess(1234, (event) {
writeln("Event: ", event.type, " for PID ", event.pid);
});
// ... later ...
monitor.stop();