pool

package
v0.0.0-...-e583d1a Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RUNNING = 1
	STOPED  = 0
)

Variables

View Source
var ErrInvalidPoolCap = errors.New("invalid pool cap")
View Source
var ErrPoolAlreadyClosed = errors.New("pool already closed")

Functions

This section is empty.

Types

type Pool

type Pool struct {
	PanicHandler func(interface{}) //错误处理
	// contains filtered or unexported fields
}

func NewPool

func NewPool(capacity uint64) (*Pool, error)

func (*Pool) Close

func (p *Pool) Close()

func (*Pool) GetCap

func (p *Pool) GetCap() uint64

func (*Pool) GetRunningWorkers

func (p *Pool) GetRunningWorkers() uint64

func (*Pool) Put

func (p *Pool) Put(task *Task) error

type Task

type Task struct {
	Handler func(v ...interface{})
	Params  []interface{}
}

Jump to

Keyboard shortcuts

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