supervisor

package
v0.9.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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
}

func New

func New(config confutil.Config, opts ...Option) Manager

type Option

type Option func(*manager)

func WithInitPolicy added in v0.6.9

func WithInitPolicy(maxRetries int, delay, maxDelay time.Duration) Option

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 WithLogger(logger log.Logger) Option

func WithMonitorPolicy added in v0.6.9

func WithMonitorPolicy(interval time.Duration, maxRetries int, restartDelay time.Duration) Option

WithMonitorPolicy: interval 0 disables monitoring; maxRetries 0 escalates a liveness failure at once, -1 restarts forever.

func WithName

func WithName(name string) Option

func WithStartPolicy added in v0.9.5

func WithStartPolicy(timeout time.Duration) Option

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

func WithStopPolicy(timeout time.Duration) Option

WithStopPolicy bounds shutdown and each restart's stop; past timeout remaining stops are forced. 0 leaves it to Stop's context.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL