Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPool = NewCoroutinePool()
创建默认池
View Source
var ErrServerStop = fmt.Errorf("服务已经停止禁止添加新任务")
Functions ¶
This section is empty.
Types ¶
type CoroutinePool ¶
CoroutinePool 支持平滑关闭的协程池
func NewCoroutinePool ¶
func NewCoroutinePool() *CoroutinePool
func (*CoroutinePool) Wait2 ¶
func (s *CoroutinePool) Wait2(e time.Duration) (err error)
Wait2 等待已经添加的任务执行完成
func (*CoroutinePool) WithMaxGoroutines ¶
func (s *CoroutinePool) WithMaxGoroutines(n int)
WithMaxGoroutines 限制了池中goroutines的数量。 默认为无限制。如果n<1,则会出现恐慌。
Click to show internal directories.
Click to hide internal directories.