A job record from the server.
Returned by Zizq.enqueue/2, yielded by the take stream, and listed
by the query API. Which fields are populated depends on the job's
lifecycle state — :dequeued_at is only set once a worker has taken
it, :completed_at only once it has finished — so treat anything
optional as possibly nil.
Timestamps are DateTime.t/0 in UTC.
Summary
Types
@type status() :: :scheduled | :ready | :in_flight | :completed | :dead
Lifecycle state.
:scheduled— stored, but scheduled for a future date/time and not eligible until:ready_atis reached — also used for retries when:attemptsis non-zero:ready— queued and waiting for a worker when it reaches the too of the queue:in_flight— delivered to a worker, awaiting acknowledgement:completed— finished successfully:dead— failed and exhausted its retry limit
@type t() :: %Zizq.Job{ attempts: non_neg_integer(), backoff: Zizq.Backoff.t() | nil, batch: Zizq.BatchConfig.t() | nil, completed_at: DateTime.t() | nil, dequeued_at: DateTime.t() | nil, duplicate: boolean() | nil, failed_at: DateTime.t() | nil, folded: boolean() | nil, id: String.t(), payload: term(), priority: non_neg_integer(), purge_at: DateTime.t() | nil, queue: String.t(), ready_at: DateTime.t() | nil, retention: Zizq.Retention.t() | nil, retry_limit: non_neg_integer() | nil, status: status(), type: String.t(), unique_key: String.t() | nil, unique_while: String.t() | nil }