worker

package
v0.0.0-...-6dd56dc Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 4 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Worker

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

func NewWorker

func NewWorker(f WorkerFunc, opts ...WorkerOption) (*Worker, error)

func (*Worker) AddParallelism

func (w *Worker) AddParallelism(parallelism int32)

func (*Worker) Process

func (w *Worker) Process(ctx context.Context)

func (*Worker) SetLoopCount

func (w *Worker) SetLoopCount(count int32)

func (*Worker) SetParallelism

func (w *Worker) SetParallelism(parallelism int32)

func (*Worker) Wait

func (w *Worker) Wait()

type WorkerFunc

type WorkerFunc func(context.Context, int)

type WorkerOption

type WorkerOption func(*Worker) error

func WithInfinityLoop

func WithInfinityLoop() WorkerOption

func WithLoopCount

func WithLoopCount(count int32) WorkerOption

func WithMaxParallelism

func WithMaxParallelism(parallelism int32) WorkerOption

func WithUnlimitedParallelism

func WithUnlimitedParallelism() WorkerOption

Jump to

Keyboard shortcuts

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