Versions in this module Expand all Collapse all v0 v0.1.0 Nov 5, 2018 Changes in this version + var ErrAttemptToChangeStatusOfTaskInProcessing = errors.New("taskqueue: Change status of tasks in prcoessing is not allowed") + var ErrAttemptToChangeStatusOfTaskToProcessing = errors.New("taskqueue: Change status of tasks to prcoessing is not allowed") + var ErrInvaildPriority = errors.New("taskqueue: Priority must > 0") + var ErrNoTasksInPending = errors.New(`taskqueue: No task in the pending queue`) + var ErrTaskExists = errors.New("taskqueue: Task already exists") + type EnqueueOptions struct + Frozen bool + MaxAttempts int + Priority int + ToHead bool + type ProcessResult int + const ProcessResultFailed + const ProcessResultGivenUp + const ProcessResultRetry + const ProcessResultShouldBeExcluded + const ProcessResultShouldBeFrozen + const ProcessResultSuccessful + type Refresher func(status TaskStatus, id int, taskType string, taskData []byte) TaskStatus + type TaskQueue interface + BatchRefreshStatuses func(appliedStatuses TaskStatusSet, appliedTaskTypes []string, filter Refresher) (err error) + Close func() (err error) + DequeueForProcess func() (id int, taskType string, taskData []byte, err error) + EnqueueWithOptions func(taskType string, taskData []byte, opts EnqueueOptions) (id int, err error) + ReportProcessResult func(id int, result ProcessResult) (err error) + type TaskStatus uint8 + const TaskStatusExcluded + const TaskStatusFinished + const TaskStatusFrozen + const TaskStatusGivenUp + const TaskStatusPending + const TaskStatusProcessing + func (s TaskStatus) String() (name string) + type TaskStatusSet TaskStatus + func (set TaskStatusSet) GetStatuses() (ss []TaskStatus)