Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrGracefulStop = errors.New("stop")
ErrGracefulStop is a special error, if returned from within loop function, will stop that loop without returning any error
Functions ¶
Types ¶
type ParanoidGroup ¶
type ParanoidGroup struct {
// contains filtered or unexported fields
}
ParanoidGroup is a special primitive to run groups of goroutines, e.g. loops. If one of them fails (exits with an error), the wait group will unblock the flow, so the user has option to cancel the rest of routines or restart that single routine.
func (*ParanoidGroup) Go ¶
func (p *ParanoidGroup) Go(fn func() error)
func (*ParanoidGroup) Initialized ¶
func (p *ParanoidGroup) Initialized() bool
func (*ParanoidGroup) Wait ¶
func (p *ParanoidGroup) Wait() error
Wait returns an error if one or more tasks failed, otherwise all tasks exited with no errors.
Click to show internal directories.
Click to hide internal directories.