zpool

package
v1.7.12 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 8 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 interface{}

Task Define function callbacks

type WorkPool added in v1.1.16

type WorkPool struct {
	New func()
	// contains filtered or unexported fields
}

func New

func New(size 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 the pool

func (*WorkPool) Continue added in v1.1.16

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

Continue to work

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) Injector added in v1.3.0

func (wp *WorkPool) Injector() zdi.TypeMapper

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)

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

func (*WorkPool) Wait added in v1.6.5

func (wp *WorkPool) Wait()

Wait for the task to finish

Jump to

Keyboard shortcuts

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