Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TaskPool ¶
type TaskPool struct {
// contains filtered or unexported fields
}
TaskPool 任务池
func NewTaskPool ¶
func NewTaskPool(poolName string, capacity int, opts ...TaskPoolOption) *TaskPool
NewTaskPool 通过此方法内部创建 ctx, 只能通过 Close() 来关闭协程池
func (*TaskPool) FreeWorkerQueueLen ¶
FreeWorkerQueueLen 空闲队列池里的长度
type TaskPoolOption ¶
type TaskPoolOption func(p *TaskPool)
func WithPolTime ¶
func WithPolTime(t time.Duration) TaskPoolOption
WithPolTime 设置 taskPool 中哨兵轮询地时间
func WithWorkerMaxLifeCycle ¶
func WithWorkerMaxLifeCycle(timeForSec sec) TaskPoolOption
WithWorkerMaxLifeCycle 设置 taskPool 中空闲的 worker 存活的时间
Click to show internal directories.
Click to hide internal directories.