Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool struct { Tasks []*Task // contains filtered or unexported fields }
Pool is a worker group that runs a number of tasks at a configured concurrency.
func (*Pool) GetErrors ¶
GetErrors returns all errors from tasks run. Its result is only meaningful after Run has been called.
type Task ¶
type Task struct { // Err holds an error that occurred during a task. Its result is only // meaningful after Run has been called for the pool that holds it. Err error Result TaskResult // contains filtered or unexported fields }
Task encapsulates a work item that should go in a work pool.
func NewTask ¶
func NewTask(f func() (TaskResult, error)) *Task
NewTask initializes a new task based on a given work function.
type TaskResult ¶
type TaskResult interface{}
Click to show internal directories.
Click to hide internal directories.