worker

package
v0.0.1-rc11 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSubmitTimeout  = errors.New("exceeded maximum capacity abd submit timeout")
	ErrWorkerReleased = errors.New("worker has released")
)

Functions

This section is empty.

Types

type Logger

type Logger interface {
	// Printf must have the same semantics as log.Printf.
	Printf(format string, args ...interface{})
}

Logger is used for logging formatted messages.

type Option

type Option func(*Pool)

func WithCapacity

func WithCapacity(capacity int) Option

func WithSubmitTimeout

func WithSubmitTimeout(timeout time.Duration) Option

type Pool

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

func New

func New(name string, opts ...Option) *Pool

func (*Pool) Release

func (p *Pool) Release()

func (*Pool) Submit

func (p *Pool) Submit(t Task) error

type Task

type Task func()

Jump to

Keyboard shortcuts

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