Documentation ¶
Index ¶
- Variables
- func BuildIndexName(queue queue.Name) common.IndexName
- func NewService(client *elasticsearch.Client, settings config.Tasks) task.Service
- type EsService
- func (e *EsService) ArchiveOldTasks(ctx context.Context, archiveCompletedBefore task.CompletedAt, scrollSize uint, ...) error
- func (e *EsService) Claim(ctx context.Context, workerId worker.Id, queues []queue.Name, ...) ([]task.Task, error)
- func (e *EsService) Create(ctx context.Context, newTask *task.NewTask) (*task.Task, error)
- func (e *EsService) Get(ctx context.Context, queue queue.Name, taskId task.Id) (*task.Task, error)
- func (e *EsService) MarkDone(ctx context.Context, workerId worker.Id, queue queue.Name, taskId task.Id, ...) (*task.Task, error)
- func (e *EsService) MarkFailed(ctx context.Context, workerId worker.Id, queue queue.Name, taskId task.Id, ...) (*task.Task, error)
- func (e *EsService) OutstandingTasksCount(ctx context.Context, queue queue.Name, recurringTaskId task.RecurringTaskId) (uint, error)
- func (e *EsService) ReapTimedOutTasks(ctx context.Context, scrollSize uint, scrollTtl time.Duration) error
- func (e *EsService) RefreshAsNeeded(ctx context.Context, name queue.Name) error
- func (e *EsService) ReportIn(ctx context.Context, workerId worker.Id, queue queue.Name, taskId task.Id, ...) (*task.Task, error)
- func (e *EsService) SetUTCGetter(getter func() time.Time)
- func (e *EsService) UnClaim(ctx context.Context, workerId worker.Id, queue queue.Name, taskId task.Id) (*task.Task, error)
- type PersistedTaskData
Constants ¶
This section is empty.
Variables ¶
View Source
var TasquesArchiveIndex = ".tasques_archive"
View Source
var TasquesQueuePrefix = ".tasques_queue-"
Functions ¶
Types ¶
type EsService ¶
type EsService struct {
// contains filtered or unexported fields
}
func (*EsService) ArchiveOldTasks ¶
func (*EsService) MarkFailed ¶
func (*EsService) OutstandingTasksCount ¶
func (*EsService) ReapTimedOutTasks ¶
func (*EsService) RefreshAsNeeded ¶
func (*EsService) SetUTCGetter ¶
For testing
type PersistedTaskData ¶
type PersistedTaskData struct { Id string `json:"id"` Queue string `json:"queue"` RetryTimes uint `json:"retry_times"` // This doesn't map to the domain model 1:1 because storing _attempts_ instead of retires // allows us to not need to adjust the counts for timeouts, and instead issue a simple update-by-query RemainingAttempts uint `json:"remaining_attempts"` Kind string `json:"kind"` State task.State `json:"state"` RunAt time.Time `json:"run_at"` ProcessingTimeout time.Duration `json:"processing_timeout"` Priority int `json:"priority"` Args *jsonObjMap `json:"args,omitempty"` Context *jsonObjMap `json:"context,omitempty"` LastEnqueuedAt time.Time `json:"last_enqueued_at"` LastClaimed *persistedLastClaimed `json:"last_claimed,omitempty"` Metadata common.PersistedMetadata `json:"metadata"` RecurringTaskId *string `json:"recurring_task_id,omitempty"` }
func ToPersistedTask ¶
func ToPersistedTask(task *task.Task) PersistedTaskData
Click to show internal directories.
Click to hide internal directories.