Documentation
¶
Overview ¶
Package entity contains domain entities for the task queue system.
Index ¶
Constants ¶
View Source
const ( // TaskStatusNew is a new task. TaskStatusNew = "new" // TaskStatusPending is a task waiting to be processed. TaskStatusPending = "pending" // TaskStatusProcessing is a task in progress. TaskStatusProcessing = "processing" // TaskStatusDone is a task that was processed successfully. TaskStatusDone = "done" // TaskStatusCanceled is a canceled task. TaskStatusCanceled = "canceled" // TaskStatusError is a task is processed with an error and HAS attempts. TaskStatusError = "error" // TaskStatusAttemptsLeft is a task that was processed with an error and NO attempts. TaskStatusAttemptsLeft = "attempts_left" )
Task status constants define the possible states of a task in the queue.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Task ¶
type Task struct {
ID uuid.UUID
Type TaskType
ExternalID string
Payload string
Status TaskStatus
Attempts int32
Errors *string
CreatedAt time.Time
UpdatedAt *time.Time
NextAttemptAt time.Time
}
Task represents a unit of work in the queue system.
func NewTaskWithExternalID ¶
NewTaskWithExternalID creates a new task with a custom external ID.
Click to show internal directories.
Click to hide internal directories.