pool

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPoolTernimated = errors.New("pool is ternimated")
	ErrTimeout        = errors.New("timeout")
)

Functions

This section is empty.

Types

type Pool

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

func NewPool

func NewPool(size int, workers int) *Pool

func (*Pool) Shutdown

func (p *Pool) Shutdown()

func (*Pool) Submit

func (p *Pool) Submit(timeout time.Duration, task Task) error

func (*Pool) SubmitFn

func (p *Pool) SubmitFn(timeout time.Duration, fn func()) error

type Task

type Task interface {
	Execute()
}

Jump to

Keyboard shortcuts

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