workerpool

package module
v0.0.0-...-1183800 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MPL-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSkipTask = errors.New("skip the task")

Functions

func NewWorkPool

func NewWorkPool(size int) *workPool

NewWorkPool creates a new worker pool which has "size" numbers of workers.

Types

type Result

type Result struct {
	Value interface{}
	Error error
}

type ResultHandler

type ResultHandler func(interface{}) error

type WorkPool

type WorkPool interface {
	Run(ResultHandler)
	Done() error
	AddTask(task) bool
}

Jump to

Keyboard shortcuts

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