Documentation ¶ Index ¶ type Pool func NewWorkerPool(size int) *Pool func (p *Pool) Start(ctx context.Context) func (p *Pool) Stop() func (p *Pool) Submit(task func(context.Context)) type Worker func NewWorker(run func(context.Context)) Worker Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Pool ¶ added in v0.6.0 type Pool struct { // contains filtered or unexported fields } func NewWorkerPool ¶ added in v0.6.0 func NewWorkerPool(size int) *Pool func (*Pool) Start ¶ added in v0.6.0 func (p *Pool) Start(ctx context.Context) func (*Pool) Stop ¶ added in v0.6.0 func (p *Pool) Stop() func (*Pool) Submit ¶ added in v0.6.0 func (p *Pool) Submit(task func(context.Context)) type Worker ¶ type Worker interface { Start(context.Context) Stop() Done() <-chan struct{} } func NewWorker ¶ func NewWorker(run func(context.Context)) Worker Source Files ¶ View all Source files pool.goworker.go Click to show internal directories. Click to hide internal directories.