upool

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrResizeDeltaInvalid error = errors.New("resize capacity with wrong delta number")
	ErrResizeUnable       error = errors.New("resize capacity unable now")
	ErrResizeExcuting     error = errors.New("resize capacity is excuting now")
)

Functions

This section is empty.

Types

type TaskHandler

type TaskHandler interface {
	Execute()
}

type TaskPool

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

func NewTaskPool

func NewTaskPool(max uint64) *TaskPool

func (*TaskPool) Close

func (tp *TaskPool) Close() bool

func (*TaskPool) GetImf

func (tp *TaskPool) GetImf() (uint64, uint64)

返回 cap, running worker num(in goroutine)

func (*TaskPool) Put

func (tp *TaskPool) Put(task TaskHandler)

func (*TaskPool) ResizeCap

func (tp *TaskPool) ResizeCap(delta int) error

Jump to

Keyboard shortcuts

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