Documentation ¶
Overview ¶
Package parallelizer features some utilities to help run tasks in parallel.
Index ¶
Constants ¶
View Source
const (
// The default number of workers.
DefaultNumOfWorkers = 4
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorFlag ¶
type ErrorFlag struct {
// contains filtered or unexported fields
}
ErrorFlag is a flag for indicating whether an error has occurred when running tasks in parallel with the parallelizer.
type Parallerlizer ¶
type Parallerlizer struct {
// contains filtered or unexported fields
}
Parallelizer helps run tasks in parallel.
func NewParallelizer ¶
func NewParallelizer(workers int) *Parallerlizer
NewParallelizer returns a Parallelizer for running tasks in parallel.
func (*Parallerlizer) ParallelizeUntil ¶
func (p *Parallerlizer) ParallelizeUntil(ctx context.Context, pieces int, doWork workqueue.DoWorkPieceFunc, operation string)
ParallelizeUntil wraps workqueue.ParallelizeUntil for running tasks in parallel.
Click to show internal directories.
Click to hide internal directories.