v0.2.2
Adds configuration option StatusChannel
that allows you to receive
status notifications whenever a descendant process (*child
) is reaped.
config := reaper.Config{
Pid: 0,
Options: 0,
Debug: true,
DisablePid1Check: false,
StatusChannel: make(chan reaper.Status, 42),
}
go func() {
select {
case status, ok := <-config.StatusChannel:
if !ok {
return
}
// process status (reaper.Status)
}
}()
// Start background reaping of orphaned child processes.
go reaper.Start(config)