concurrency

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job func(ctx context.Context) error

type WorkerPool

type WorkerPool struct {
	// contains filtered or unexported fields
}

func NewWorkerPool

func NewWorkerPool(workers uint) *WorkerPool

func (*WorkerPool) AddJob

func (r *WorkerPool) AddJob(jobs ...Job) *WorkerPool

func (*WorkerPool) Run

func (r *WorkerPool) Run(ctx context.Context) ([]error, error)

Run runs the jobs then returns any errors with the same order as the jobs. The jobs will be cleared after execution.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL