workers

package
v0.0.0-...-f03ac24 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPoolClosed = errors.New("pool closed")
View Source
var ErrTokenClosed = errors.New("token closed")

Functions

This section is empty.

Types

type Pool

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

func NewPool

func NewPool(size ...int) *Pool

func (*Pool) Close

func (p *Pool) Close() error

func (*Pool) Dispatch

func (p *Pool) Dispatch(task Task) (Tokener, error)

type Task

type Task func(ctx context.Context) error

type Tokener

type Tokener interface {
	WaitWithContext(ctx context.Context) error
	Cancel()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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