Documentation
¶
Index ¶
Constants ¶
Variables ¶
var ErrDrainTimeout = errors.New("app: modules still running at the shutdown deadline")
ErrDrainTimeout means a module ignored its context and was abandoned.
Functions ¶
Types ¶
type DrainBudget ¶
DrainBudget is how much time a Run has to return once its context is cancelled. A module that drains inside Run should read it before it provides, to check that its own drain time fits.
func (DrainBudget) String ¶
func (b DrainBudget) String() string
type Option ¶
type Option func(*options)
func WithDrainTimeout ¶
WithDrainTimeout bounds how long the runnable modules have to return once their context is cancelled, after which they are abandoned. WithDrainTimeout and WithStopTimeout together have to fit inside WithShutdownTimeout.
func WithShutdownTimeout ¶
WithShutdownTimeout sets the ceiling WithDrainTimeout and WithStopTimeout have to fit inside, and comes from the supervisor's grace period rather than anything this process decides.
func WithStopTimeout ¶
WithStopTimeout bounds releasing what the modules hold, on its own budget rather than what draining left over. WithDrainTimeout and WithStopTimeout together have to fit inside WithShutdownTimeout.