workerpool

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyRunning = errors.New("worker pool is already running")

Functions

This section is empty.

Types

type Executor

type Executor interface {
	Execute(ctx context.Context) error
}

type Option

type Option func(*WorkerPool)

func WithExecutionTimeout

func WithExecutionTimeout(timeout time.Duration) Option

func WithName

func WithName(name string) Option

func WithTickInterval

func WithTickInterval(duration time.Duration) Option

func WithWorkerCount

func WithWorkerCount(count int) Option

type WorkerPool

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

func New

func New(executor Executor, opts ...Option) *WorkerPool

func (*WorkerPool) Name

func (pool *WorkerPool) Name() string

func (*WorkerPool) Start

func (pool *WorkerPool) Start(ctx context.Context) error

func (*WorkerPool) Stop

func (pool *WorkerPool) Stop() error

Jump to

Keyboard shortcuts

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