Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorGroup ¶
ErrorGroup is an error that contains a list of errors. This interface is implimented by `multierr.multiError`
type Filter ¶
Filter is a function that takes an error and returns it (or a modified error) if it should be retained by `TaskGroup.Wait`.
type TaskGroup ¶
type TaskGroup struct {
// contains filtered or unexported fields
}
TaskGroup is a helper to make it easy to execute one or more `Task` functions and collect their errors, if any.
func New ¶
func New() *TaskGroup
New returns a new TaskGroup, which can be used to execute one or more `Task` functions and collect their errors, if any.
func NewWithFilter ¶
NewWithFilter returns a new TaskGroup, like `New`, but with a filter for optionally ignoring/muting errors using a `Filter` function.
func (*TaskGroup) Wait ¶
Wait blocks until all tasks are complete and returns a MultiError of their errors, if any. If the TaskGroup was created with a Filter, the filter will be called for each non-nil Task error, and only the non-nil error results will be returned. If multiple tasks errored (and more than one was not filtered), an `ErrorGroup` will be returned. Otherwise, returns the only error, or nil.