Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Task ¶
type Task struct { Err error Result interface{} // contains filtered or unexported fields }
a task wraps a function and its response
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
func NewWorkerPool ¶
func NewWorkerPool() *WorkerPool
func NewWorkerPoolWithSize ¶
func NewWorkerPoolWithSize(size int) *WorkerPool
func (*WorkerPool) AddTask ¶
func (p *WorkerPool) AddTask(taskFunc func() (interface{}, error))
func (*WorkerPool) GetTasks ¶
func (p *WorkerPool) GetTasks() []*Task
func (*WorkerPool) StopWait ¶
func (p *WorkerPool) StopWait()
Click to show internal directories.
Click to hide internal directories.