type

Task

Adapter-neutral durable task data.

Properties

PropertyTypeDescription
IDstringThe ID value.
SlugstringThe Slug value.
QueuestringThe Queue value.
ConcurrencyKeystringThe ConcurrencyKey value.
Inputjson.RawMessageThe Input value.
Outputjson.RawMessageThe Output value.
StateTaskStateThe State value.
RunAttime.TimeThe RunAt value.
AttemptsintThe Attempts value.
MaxAttemptsintThe MaxAttempts value.
RetryDelaytime.DurationThe RetryDelay value.
MaxRetryDelaytime.DurationThe MaxRetryDelay value.
BackoffTaskBackoffThe Backoff value.
Timeouttime.DurationThe Timeout value.
Retentiontime.DurationThe Retention value.
LeaseTokenstringThe LeaseToken value.
LeaseExpiresAt*time.TimeThe LeaseExpiresAt value.
Target*DocumentReferenceThe Target value.
RequestedBy*DocumentReferenceThe RequestedBy value.
LastErrorCodestringThe LastErrorCode value.
LastErrorstringThe LastError value.
CreatedAttime.TimeThe CreatedAt value.
UpdatedAttime.TimeThe UpdatedAt value.
CompletedAt*time.TimeThe CompletedAt value.
RetainUntil*time.TimeThe RetainUntil value.

How it works

Input/output are data only. Executable typed handlers are compiled into the application and selected from the validated registry by Slug.

Full signature

type Task struct { ID string Slug string Queue string ConcurrencyKey string Input json.RawMessage Output json.RawMessage State TaskState RunAt time.Time Attempts int MaxAttempts int RetryDelay time.Duration MaxRetryDelay time.Duration Backoff TaskBackoff Timeout time.Duration Retention time.Duration LeaseToken string LeaseExpiresAt *time.Time Target *DocumentReference RequestedBy *DocumentReference LastErrorCode string LastError string CreatedAt time.Time UpdatedAt time.Time CompletedAt *time.Time RetainUntil *time.Time }

Source store/store.go:849