Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Picker ¶ added in v0.16.0
type Picker struct {
// contains filtered or unexported fields
}
Picker provides synchronization, and Context cancelation for groups of goroutines working on subtasks of a common task. Inspired by errGroup
func WithContext ¶ added in v0.16.0
WithContext returns a new Picker and an associated Context derived from ctx. and cancel when first element return.
func WithTimeout ¶ added in v0.16.0
WithTimeout returns a new Picker and an associated Context derived from ctx with timeout.
func WithoutAutoCancel ¶ added in v0.16.0
WithoutAutoCancel returns a new Picker and an associated Context derived from ctx, but it wouldn't cancel context when the first element return.
func (*Picker) Go ¶ added in v0.16.0
Go calls the given function in a new goroutine. The first call to return a nil error cancels the group; its result will be returned by Wait.
func (*Picker) Wait ¶ added in v0.16.0
func (p *Picker) Wait() interface{}
Wait blocks until all function calls from the Go method have returned, then returns the first nil error result (if any) from them.
func (*Picker) WaitWithoutCancel ¶ added in v0.16.0
func (p *Picker) WaitWithoutCancel() interface{}
WaitWithoutCancel blocks until the first result return, if timeout will return nil.