pool

package
v0.0.0-...-503c688 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPoolClosed will be returned when submitting task to a closed pool.
	ErrPoolClosed = errors.New("this pool has been closed")

	// ErrPoolOverload will be returned when the pool is full and no workers available.
	ErrPoolOverload = errors.New("the number of concurrency has reached the upper limit and Block is set")

	// ErrPoolParamsInvalid will be returned when the pool params are invalid.
	ErrPoolParamsInvalid = errors.New("the pool params are invalid")
)

Functions

This section is empty.

Types

type BasePool

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

BasePool is base class of pool

func NewBasePool

func NewBasePool() BasePool

NewBasePool is to create a new BasePool.

func (*BasePool) GenTaskID

func (p *BasePool) GenTaskID() uint64

GenTaskID is to get a new task ID.

func (*BasePool) LastTunerTs

func (p *BasePool) LastTunerTs() time.Time

LastTunerTs returns the last time when the pool was tuned.

func (*BasePool) Name

func (p *BasePool) Name() string

Name is to get name.

func (*BasePool) SetLastTuneTs

func (p *BasePool) SetLastTuneTs(t time.Time)

SetLastTuneTs sets the last time when the pool was tuned.

func (*BasePool) SetName

func (p *BasePool) SetName(name string)

SetName is to set name.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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