Documentation
¶
Overview ¶
Package daemon supervises an auxiliary process that runs alongside a cluster: it starts the process, waits until the process is actually serving, and terminates it. It knows nothing about any particular daemon.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Name string // used in error messages; defaults to the binary's base name
BinaryPath string
Args []string
Env []string // appended to the parent environment
Dir string
// Ready decides when Start may return. A nil Probe means the process is
// considered ready as soon as it is alive.
Ready Probe
ReadyWait time.Duration // defaults to defaultReadyWait
}
Config describes one process to supervise.
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon is a running supervised process.
func Start ¶
Start launches the process and returns once it is ready.
Readiness races three outcomes: the probe succeeds, the process exits, or the deadline passes. Watching for the exit matters as much as the probe: a daemon that opens its port and then dies would otherwise leave the caller blocked for the whole deadline with no explanation.
Click to show internal directories.
Click to hide internal directories.