Documentation
¶
Overview ¶
Package supervisor runs handler processes in their own process group so a timeout or cancel kills the whole tree with kill(-pgid) (RFC 4.2, 6.7).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GroupAlive ¶
GroupAlive reports whether any process in the group still exists.
Types ¶
type Outcome ¶
type Outcome struct {
ExitCode int
TimedOut bool
OutputExceeded bool
Cancelled bool
Stdout []byte // only kept when OnLine is nil
Stderr string
Err error
Duration time.Duration
}
Outcome is how the process ended.
type Spec ¶
type Spec struct {
Argv []string
Dir string
Env []string
Stdin []byte
Timeout time.Duration
MaxOutput int64
// OnStart is called with pid and pgid right after start.
OnStart func(pid, pgid int)
// OnLine receives every stdout line (without the newline).
OnLine func([]byte)
// IdleGrace: after a machine sleep, a run past its deadline is killed
// only if it produced no output in the last IdleGrace (RFC 8.4).
IdleGrace time.Duration
}
Spec describes one process.