Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stage ¶
type Stage interface {
// Start starts f in a new goroutine attached to the Stage.
Start(func())
// StartWithChannel starts f in a new goroutine attached to the Stage.
// Stage context's Done() channel is passed to f as an argument. f should stop when it is available.
StartWithChannel(func(stopCh <-chan struct{}))
// StartWithContext starts f in a new goroutine attached to the Stage.
// Stage context is passed to f as an argument. f should stop when context's Done() channel is available.
StartWithContext(func(context.Context))
}
type Stager ¶
type Stager interface {
// NextStageWithContext adds a new stage to the Stager.
NextStage() Stage
// NextStageWithContext adds a new stage to the Stager. Provided ctxParent is used as the parent context for the
// Stage's context.
NextStageWithContext(ctxParent context.Context) Stage
// Shutdown iterates Stages in reverse order, cancelling their context and waiting for all started goroutines
// to finish for each Stage.
Shutdown()
}
Click to show internal directories.
Click to hide internal directories.