Documentation
¶
Overview ¶
Package errgroup runs a group of functions in goroutines, collects the first error, and cancels the group's context when one fails. It is the subset of golang.org/x/sync/errgroup the agent loop uses (WithContext, SetLimit, Go, Wait), with the same semantics, written against the standard library so the core module requires nothing outside it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
A Group is a set of goroutines working on one task. Create it with WithContext.
func WithContext ¶
WithContext returns a new Group and a context derived from ctx. The context is cancelled, with the error as its cause, the first time a function passed to Go returns a non-nil error, and otherwise when Wait returns.
func (*Group) Go ¶
Go runs f in a new goroutine, first blocking while the group is at its limit. The first non-nil error any f returns is Wait's result and cancels the group's context.