worker

package
v0.0.0-...-cd76967 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2021 License: MIT Imports: 2 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 interface {
	Process(ctx context.Context) error
}

type Result

type Result struct {
	Job Job
	Err error
}

type WorkerPool

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

func NewWorkerPool

func NewWorkerPool(concurrency int) *WorkerPool

func (*WorkerPool) Results

func (p *WorkerPool) Results() []Result

func (*WorkerPool) Work

func (p *WorkerPool) Work(ctx context.Context, jobs []Job) []Result

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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