Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandStarter ¶
type CommandStarter struct {
ShareProcessGroup bool
// CommandFactory binds installed provenance and committed config for root mode.
// The returned release closes capabilities after Start, including failure.
CommandFactory func(context.Context) (core.CoreCommand, func() error, error)
BinaryPath string
DataDir string
ConfigPath string
Stdout io.Writer
Stderr io.Writer
}
func (CommandStarter) Start ¶
func (s CommandStarter) Start() (Child, error)
type HealthChecker ¶
type Observation ¶
type Options ¶
type Options struct {
Starter Starter
// BeforeStart prepares each child and returns ownership held until Start completes.
BeforeStart func(context.Context) (release func(), err error)
Health HealthChecker
Waiter Waiter
Now func() time.Time
Observe func(Observation)
MinimumBackoff time.Duration
MaximumBackoff time.Duration
StableAfter time.Duration
GracePeriod time.Duration
HealthInterval time.Duration
StopTimeout time.Duration
DiagnosticReporter diagnostics.Reporter
}
type Supervisor ¶
type Supervisor struct {
// contains filtered or unexported fields
}
func New ¶
func New(options Options) *Supervisor
func (*Supervisor) Maintain ¶ added in v0.9.3
func (s *Supervisor) Maintain(ctx context.Context, work func() error) error
Maintain runs work only while the owned child and monitor are stopped. Work must not call supervisor methods. Once accepted, cancellation does not detach work: the caller waits until commit/recovery has converged. Idle maintenance preserves the stopped state and never starts a process.