Documentation ¶
Index ¶
- Constants
- func LogusStatusCodes(tasks []ITask) typelog.LogType
- func RunTasksInTempPool(tasks []ITask, opts ...TaskPoolOption)
- type ITask
- type Task
- type TaskPool
- type TaskPoolOption
- func WithAllowFailedTasks() TaskPoolOption
- func WithDisableParallelism(disable_parallelism worker_types.DebugDisableParallelism) TaskPoolOption
- func WithTaskObServer(task_observer func(task ITask)) TaskPoolOption
- func WithTaskTimeout(value worker_types.Seconds) TaskPoolOption
- func WithWorkersAmount(value int) TaskPoolOption
- type TaskPoolPeristent
Constants ¶
View Source
const ( CodeSuccess worker_types.TaskStatusCode = 0 CodeTimeout worker_types.TaskStatusCode = 1 CodeFailure worker_types.TaskStatusCode = 2 )
Variables ¶
This section is empty.
Functions ¶
func LogusStatusCodes ¶
func RunTasksInTempPool ¶
func RunTasksInTempPool(tasks []ITask, opts ...TaskPoolOption)
Types ¶
type ITask ¶
type ITask interface { RunTask(worker_id worker_types.WorkerID) error IsDone() bool GetStatusCode() worker_types.TaskStatusCode SetAsDone() // contains filtered or unexported methods }
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
func NewTask ¶
func NewTask(id worker_types.TaskID) *Task
func (*Task) GetID ¶
func (t *Task) GetID() worker_types.TaskID
func (*Task) GetStatusCode ¶
func (t *Task) GetStatusCode() worker_types.TaskStatusCode
type TaskPool ¶
type TaskPool struct {
// contains filtered or unexported fields
}
func NewTaskPool ¶
func NewTaskPool(opts ...TaskPoolOption) *TaskPool
type TaskPoolOption ¶
type TaskPoolOption func(r *TaskPool)
func WithAllowFailedTasks ¶
func WithAllowFailedTasks() TaskPoolOption
func WithDisableParallelism ¶
func WithDisableParallelism(disable_parallelism worker_types.DebugDisableParallelism) TaskPoolOption
func WithTaskObServer ¶
func WithTaskObServer(task_observer func(task ITask)) TaskPoolOption
func WithTaskTimeout ¶
func WithTaskTimeout(value worker_types.Seconds) TaskPoolOption
func WithWorkersAmount ¶
func WithWorkersAmount(value int) TaskPoolOption
type TaskPoolPeristent ¶
type TaskPoolPeristent struct { *TaskPool // contains filtered or unexported fields }
func NewTaskPoolPersistent ¶
func NewTaskPoolPersistent(opts ...TaskPoolOption) *TaskPoolPeristent
func (*TaskPoolPeristent) DelayTask ¶
func (j *TaskPoolPeristent) DelayTask(task ITask)
Click to show internal directories.
Click to hide internal directories.