workerpool

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task func()

type WorkerPool

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

func NewWorkerPool

func NewWorkerPool(workerCount int) *WorkerPool

func (*WorkerPool) CapacityAvailable added in v0.2.0

func (p *WorkerPool) CapacityAvailable() <-chan struct{}

CapacityAvailable coalesces capacity releases and increases into a nonblocking hint. Receivers must recheck FreeWorkers; the channel is never closed.

func (*WorkerPool) Close

func (p *WorkerPool) Close()

func (*WorkerPool) FreeWorkers

func (p *WorkerPool) FreeWorkers() int

func (*WorkerPool) Resize

func (p *WorkerPool) Resize(n int)

func (*WorkerPool) Submit

func (p *WorkerPool) Submit(task Task) error

func (*WorkerPool) Workers added in v0.2.0

func (p *WorkerPool) Workers() int

Workers returns the current size of the worker pool.

Jump to

Keyboard shortcuts

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