Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct {
// FailFast causes the Group to cancel all goroutines immediately
// when one goroutine returns an error.
// FailFast must be set before any [Runner] is started.
FailFast bool
// contains filtered or unexported fields
}
Group allows running a number of Runner concurrently and aggregating their errors.
Using the default value of a Group is a valid use.
Its interface is inspired by the stdlib experiement errgroup: https://pkg.go.dev/golang.org/x/sync@v0.19.0/errgroup
func WithContext ¶
WithContext returns a new Group.
A group instantiated this way should only live for the lifetime of the calling function as this stores the context, which can cause unintended side effects.
func (*Group) Go ¶
Go starts a Runner in a goroutine bound by the context.Context the Group was initialized with.
Click to show internal directories.
Click to hide internal directories.