worktool

package
v0.0.53 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WorkPool

type WorkPool struct {
	Pool *ants.Pool
}

func NewWorkPool

func NewWorkPool(poolsize int) *WorkPool

NewWorkPool - 建立一個工作池 poolsize:要有多少線呈 return WorkPool

func (*WorkPool) ChangePoolSize

func (wp *WorkPool) ChangePoolSize(poolsize int)

ChangePoolSize - 修改一個工作池 poolsize:要改多少線呈

func (*WorkPool) NewWorkPoolWithFunc

func (wp *WorkPool) NewWorkPoolWithFunc(poolsize int, poolfunc func(interface{})) (*ants.PoolWithFunc, error)

NewWorkPool - 建立WorkPool poolsize:要有多少線呈 return PoolWithFunc

func (*WorkPool) Reboot

func (wp *WorkPool) Reboot()

Reboot - 重啟WorkPool

func (*WorkPool) Release

func (wp *WorkPool) Release()

Release - 釋放WorkPool

func (*WorkPool) SubmitTask

func (wp *WorkPool) SubmitTask(task func()) error

SubmitTask - 提交一個工作到WorkPool task : 要做事的funtion

Jump to

Keyboard shortcuts

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