Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool is a buffered worker pool
type TaskResult ¶
type TaskResult interface { // get error if task failed. Err() error // wait for task done. Wait() // get task status. Status() TaskStatus // kill task. Kill() }
TaskResult is a manager of submitted task.
type TaskStatus ¶
type TaskStatus int
TaskStatus is the status of task. TaskStatus implements TaskResult interface.
const ( // TaskStatusEnqueue means task is enqueued. TaskStatusEnqueue TaskStatus = iota // TaskStatusRunning means task is running. TaskStatusRunning // TaskStatusDone means task is done. TaskStatusDone // TaskStatusKilled means task is killed. TaskStatusKilled // TaskStatusError means task error. TaskStatusError // TaskStatusQueueFull means task queue is full. TaskStatusQueueFull // TaskStatusTooManyWorker means task concurrence is greater then worker pool max worker count. TaskStatusTooManyWorker // TaskStatusPoolClosed means task run worker pool closed. TaskStatusPoolClosed )
func (TaskStatus) Err ¶
func (t TaskStatus) Err() error
func (TaskStatus) Error ¶
func (t TaskStatus) Error() string
func (TaskStatus) Kill ¶
func (t TaskStatus) Kill()
func (TaskStatus) Status ¶
func (t TaskStatus) Status() TaskStatus
func (TaskStatus) String ¶
func (t TaskStatus) String() string
func (TaskStatus) Wait ¶
func (t TaskStatus) Wait()
Click to show internal directories.
Click to hide internal directories.