interface
TaskStore
type TaskStore interface {
EnqueueTask(context.Context, Task) (Task, error)
FindTask(context.Context, string) (Task, error)
ListTasks(context.Context, TaskList) ([]Task, error)
CancelTask(context.Context, string) error
// DismissTaskForTarget removes one task only when its slug and target match.
// This powers target-scoped action lists such as scheduled publishing: every
// listed queued, running, failed, or canceled item remains dismissible while
// general CancelTask keeps retained cancellation status for typed callers.
DismissTaskForTarget(context.Context, string, string, DocumentReference) error
ClaimTasks(context.Context, TaskClaim) ([]Task, error)
HeartbeatTask(context.Context, string, string, time.Duration) error
CompleteTask(context.Context, string, string, json.RawMessage) error
FailTask(context.Context, TaskFailure) error
ReleaseTask(context.Context, string, string, time.Duration, string, string) error
PruneTasks(context.Context, int) (int, error)
}General-purpose durable queue persistence.
FindTaskfunc(context.Context, string) (Task, error)- The FindTask value.
CancelTaskfunc(context.Context, string) error- The CancelTask value.
DismissTaskForTargetfunc(context.Context, string, string, DocumentReference) error- DismissTaskForTarget removes one task only when its slug and target match. This powers target-scoped action lists such as scheduled publishing: every listed queued, running, failed, or canceled item remains dismissible while general CancelTask keeps retained cancellation status for typed callers.
HeartbeatTaskfunc(context.Context, string, string, time.Duration) error- The HeartbeatTask value.
CompleteTaskfunc(context.Context, string, string, json.RawMessage) error- The CompleteTask value.
FailTaskfunc(context.Context, TaskFailure) error- The FailTask value.
ReleaseTaskfunc(context.Context, string, string, time.Duration, string, string) error- The ReleaseTask value.
PruneTasksfunc(context.Context, int) (int, error)- The PruneTasks value.
Use an authoritative store clock, reclaim expired leases, enforce concurrency keys atomically, and return ErrTaskLeaseLost when the opaque lease token no longer owns running work. Public ValidateTask* functions validate every request boundary.