The highest tagged major version is
v2.
package
Version:
v1.5.17
Opens a new window with list of versions in this module.
Published: Mar 19, 2019
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package grpool implements a goroutine reusable pool.
Goroutine池,
用于goroutine复用,提升异步操作执行效率(避免goroutine限制,并节约内存开销).
需要注意的是,grpool提供给的公共池不提供关闭方法,自创建的池可以手动关闭掉。
goroutine池对象
创建goroutine池管理对象, 参数用于限制限制最大的goroutine数量/线程数/worker数量,非必需参数,默认不做限制
关闭池,所有的任务将会停止,此后继续添加的任务将不会被执行
func (p *Pool) ForkWorker()
创建新的worker执行任务
Source Files
¶
Click to show internal directories.
Click to hide internal directories.