Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultCapacity = 50 // 容量,最大的协程数量 DefaultTimeOut = 30 * time.Second // 任务执行的时间,超过该时间协程会退出执行该程序,返回空闲状态 DefaultIdleTime = 10 * time.Minute // 协程空闲的时间,超过该时间会自动 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoroutinePool ¶
type GoroutinePool struct {
// contains filtered or unexported fields
}
func NewGoroutinePool ¶
func NewGoroutinePool(opts ...Option) *GoroutinePool
func (*GoroutinePool) Close ¶
func (p *GoroutinePool) Close()
type Option ¶
type Option func(pool *GoroutinePool)
func WithCapacity ¶
func WithIdleTime ¶
func WithTimeout ¶
Click to show internal directories.
Click to hide internal directories.