poolKit

package
v2.8.122 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewPool func(size int, options ...ants.Option) (*ants.Pool, error) = ants.NewPool

NewPool 创建 *ants.Pool 实例.

PS: (1) 通过 "func (p *Pool) Submit(task func()) error" 执行任务,任务无参无返回值. (2) 默认情况下(即不传options):

(a) (Nonblocking: false) 阻塞模式
(b) (MaxBlockingTasks: 0) 阻塞模式下,最多因为调用Pool.Submit()而阻塞的goroutine数量 不设限制.

@param options

View Source
var NewPoolWithFunc func(size int, pf func(interface{}), options ...ants.Option) (*ants.PoolWithFunc, error) = ants.NewPoolWithFunc

NewPoolWithFunc 创建 *ants.PoolWithFunc 实例.

PS: (1) 通过 "func (p *PoolWithFunc) Invoke(args interface{}) error" 执行任务,任务有1个参数(interface{}类型)无返回值. (2) 默认情况下(即不传options):

(a) (Nonblocking: false) 阻塞模式
(b) (MaxBlockingTasks: 0) 阻塞模式下,最多因为调用Pool.Submit()而阻塞的goroutine数量 不设限制.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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