worker

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: GPL-2.0 Imports: 0 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPool

func NewPool(c *PoolConfig) *pool

func NewTask

func NewTask(f func() error) *task

Types

type Pool

type Pool interface {
	AddTask(t Task)
	AddTasks(t []Task)
	Start()
	Stop()
}

type PoolConfig

type PoolConfig struct {
	NumWorker int
	QueueSize int
}

PoolConfig Configuration for a worker pool.

type Task

type Task interface {
	WaitForResult() error
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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