Documentation
¶
Index ¶
- type Manager
- type Option
- func WithInitPolicy(maxRetries int, delay, maxDelay time.Duration) Option
- func WithLogger(logger log.Logger) Option
- func WithMonitorPolicy(interval time.Duration, maxRetries int, restartDelay time.Duration) Option
- func WithName(name string) Option
- func WithStartPolicy(timeout time.Duration) Option
- func WithStopPolicy(timeout time.Duration) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface {
model.Supervisor
// Alive fails only once in-process recovery is spent; Ready is nil iff every
// service is ready. Both read cached stats, never probe.
common.Liveness
common.Readiness
common.Initializable
common.Daemon
common.Debuggable
}
type Option ¶
type Option func(*manager)
func WithInitPolicy ¶ added in v0.6.9
WithInitPolicy retries the first Init's turns (dependency readiness and own Init): maxRetries 0 single pass, -1 until ctx ends; backoff doubles from delay (default 1s) up to maxDelay, fixed when maxDelay <= delay. A later Init, a reload's or a whole Restart's, makes one pass.
func WithLogger ¶
func WithMonitorPolicy ¶ added in v0.6.9
WithMonitorPolicy: interval 0 disables monitoring; maxRetries 0 escalates a liveness failure at once, -1 restarts forever.
func WithStartPolicy ¶ added in v0.9.5
WithStartPolicy bounds each service's Start, at the first start and at each restart; past timeout that Start's context ends, and a Start that honors it fails. 0 leaves it to the context the supervisor's Start, or the restart, was given.
func WithStopPolicy ¶ added in v0.6.9
WithStopPolicy bounds shutdown and each restart's stop; past timeout remaining stops are forced. 0 leaves it to Stop's context.