worker

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 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 Pool

type Pool interface {
	RunTask(task Task)
	Stop() error
}

Pool is the interface which must be implemented by our worker pool.

func NewPool

func NewPool(minRoutines int64) (Pool, error)

NewPool returns a new worker pool with the given number of goroutines. The returned pool can then be used to add task which are then processed by the worker pool.

type Task

type Task interface {
	Do()
}

Task is the interface which must be implemented by each task which should be added to the worker pool.

Jump to

Keyboard shortcuts

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