xrunPool

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(f func()) error

添加工作方法到线程池

func Jobs

func Jobs() int

获取池线程中所有工作方法数

func Size

func Size() int

获取线程池当前线程数

Types

type TRunPool

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

func New

func New(limit ...int) *TRunPool

func (*TRunPool) Add

func (p *TRunPool) Add(f func()) error

添加工作方法到线程池

func (*TRunPool) Cap

func (p *TRunPool) Cap() int

获取线程池最大线程数

func (*TRunPool) Close

func (p *TRunPool) Close()

关闭线程池

func (*TRunPool) IsClosed

func (p *TRunPool) IsClosed() bool

检查线程池是否已关闭

func (*TRunPool) Jobs

func (p *TRunPool) Jobs() int

获取池中当前工作方法数

func (*TRunPool) Size

func (p *TRunPool) Size() int

获取线程池当前线程数

Jump to

Keyboard shortcuts

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