Documentation
¶
Index ¶
Constants ¶
View Source
const ( LogLineGroupStarted = "Run group triggered" LogLineGroupExited = "Run group exited" LogLineGroupExitedWithError = "Run group exited with error" LogLineRunnerStarted = "Runner started" LogLineRunnerExited = "Runner exited" LogLineRunnerExitedWithError = "Runner exited with error" LogLineRunnerExitedWithContextCanceledError = "Runner exited with context canceled" )
Variables ¶
This section is empty.
Functions ¶
func WithCancelOnSignals ¶
WithCancelOnSignals will cancel the context when any of the given signals are received. If no signals are given, the default signals are used: os.Interrupt, os.Kill, syscall.SIGTERM
func WithLogger ¶
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) Add ¶
Add registers a function to run when the group is triggered with Run or Start. If the group is already running, the function will be started immediately and added to the pool.
func (*Group) Run ¶
Run runs the runners in the group until all have exited. If any function returns an error, the context passed to each is canceled. Once a group is triggered with Run, no more functions can be added
Directories
¶
Path | Synopsis |
---|---|
Package parallel provides a simpler version of errgroup where: - all goroutines are started immediately - no concurrency limit - runners receive a context - the context is canceled without passing 'cause'.
|
Package parallel provides a simpler version of errgroup where: - all goroutines are started immediately - no concurrency limit - runners receive a context - the context is canceled without passing 'cause'. |
Click to show internal directories.
Click to hide internal directories.