zpool

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPoolClosed  = errors.New("pool has been closed")
	ErrWaitTimeout = errors.New("pool wait timeout")
)

Functions

This section is empty.

Types

type PanicFunc added in v0.1.61

type PanicFunc func(err error)

type Task

type Task func()

Task Define function callbacks

type WorkPool added in v1.1.16

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

func New

func New(min int, max ...int) *WorkPool

func (*WorkPool) AdjustSize added in v1.1.16

func (wp *WorkPool) AdjustSize(workSize int)

AdjustSize adjust the pool size

func (*WorkPool) Cap added in v1.1.16

func (wp *WorkPool) Cap() uint

Cap get the number of coroutines

func (*WorkPool) Close added in v1.1.16

func (wp *WorkPool) Close()

Close close the pool

func (*WorkPool) Continue added in v1.1.16

func (wp *WorkPool) Continue(workerNum ...int)

Continue continue

func (*WorkPool) Do added in v1.1.16

func (wp *WorkPool) Do(fn Task) error

Do Add to the workpool and implement

func (*WorkPool) DoWithTimeout added in v1.1.16

func (wp *WorkPool) DoWithTimeout(fn Task, t time.Duration) error

func (*WorkPool) IsClosed added in v1.1.16

func (wp *WorkPool) IsClosed() bool

IsClosed Has it been closed

func (*WorkPool) PanicFunc added in v1.1.16

func (wp *WorkPool) PanicFunc(handler PanicFunc)

Do Add to the workpool and implement

func (*WorkPool) Pause added in v1.1.16

func (wp *WorkPool) Pause()

Pause pause

func (*WorkPool) PreInit added in v1.1.16

func (wp *WorkPool) PreInit() error

Jump to

Keyboard shortcuts

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