Skip to content

v0.2.2

Compare
Choose a tag to compare
@ramr ramr released this 26 Oct 01:13
· 6 commits to master since this release

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)