Documentation
¶
Overview ¶
Package gopool 提供可动态扩缩的有界工人池。
Do 同步等待任务结束(便于调用方在结束后做 ACK 等收尾)。 工人数在 [MinSize, MaxSize] 之间:忙时扩容,空闲超时缩回 MinSize。 停池:取消 New 传入的 ctx。
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrPoolClosed = errors.New("gopool: closed")
)
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Pool)
Option 配置 Pool。
func WithIdleTimeout ¶
WithIdleTimeout 空闲工人超过此时长且人数 > MinSize 时可回收。
Click to show internal directories.
Click to hide internal directories.