Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WorkerPool ¶
type WorkerPool struct { Size int // contains filtered or unexported fields }
func NewWorkerPool ¶
func NewWorkerPool(size int) *WorkerPool
NewWorkerPool returns a new WorkerPool, pool size is size.
func (*WorkerPool) Add ¶
func (w *WorkerPool) Add(work Work)
Add adds a work to WorkerPool, asynchronously.
func (*WorkerPool) AddSync ¶
func (w *WorkerPool) AddSync(work Work)
AddSync adds a work to WorkerPool, synchronously.
func (*WorkerPool) Wait ¶
func (w *WorkerPool) Wait()
Wait waits for all tasks in workerpool to finish.
Click to show internal directories.
Click to hide internal directories.