Documentation ¶
Overview ¶
Package syncutil provides utilities for working with asynchronous tasks and provides wrappers around the "sync" package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PipelineWaitGroup ¶
type PipelineWaitGroup struct {
// contains filtered or unexported fields
}
PipelineWaitGroup is a wrapper around a WaitGroup that runs the actions of a list of steps, handles errors, and watches for context cancellation.
func NewPipelineWaitGroup ¶
func NewPipelineWaitGroup() *PipelineWaitGroup
func (*PipelineWaitGroup) Add ¶
func (w *PipelineWaitGroup) Add(f pipeline.Pipeline, walker pipeline.Walker, wf pipeline.StepWalkFunc)
Add adds a new Action to the waitgroup. The provided function will be run in parallel with all other added functions.
func (*PipelineWaitGroup) Wait ¶
func (w *PipelineWaitGroup) Wait(ctx context.Context) error
Wait runs all provided functions (via Add(...)) and runs them in parallel and waits for them to finish. If they are not all finished before the provided timeout (via NewPipelineWaitGroup), then an error is returned. If any functions return an error, the first error encountered is returned.
type StepWaitGroup ¶
type StepWaitGroup struct {
// contains filtered or unexported fields
}
StepWaitGroup is a wrapper around a WaitGroup that runs the actions of a list of steps, handles errors, and watches for context cancellation.
func NewStepWaitGroup ¶
func NewStepWaitGroup() *StepWaitGroup
func (*StepWaitGroup) Add ¶
func (w *StepWaitGroup) Add(f pipeline.Step, opts pipeline.ActionOpts)
Add adds a new Action to the waitgroup. The provided function will be run in parallel with all other added functions.
func (*StepWaitGroup) Wait ¶
func (w *StepWaitGroup) Wait(ctx context.Context) error
Wait runs all provided functions (via Add(...)) and runs them in parallel and waits for them to finish. If they are not all finished before the provided timeout (via NewStepWaitGroup), then an error is returned. If any functions return an error, the first error encountered is returned.
type WaitGroup ¶
type WaitGroup struct {
// contains filtered or unexported fields
}
func NewWaitGroup ¶
func NewWaitGroup() *WaitGroup
func (*WaitGroup) Add ¶
func (w *WaitGroup) Add(f WaitGroupFunc)