Job inputs to be enqueued.
Building one sends nothing, so enqueues may compose: you may build
many, then hand them to Zizq.enqueue_all/2 in a single request bulk
enqueue request.
Zizq.Enqueue.new!(type: "send_email", payload: %{"user_id" => 42})Fields
:type— the job's type name used by the worker to route to an appropriate handler. Required. This is the string other languages would also enqueue to reach the same handler.:payload— arbitrary JSON-compatible data processed by the worker. Defaults to%{}.:queue— defaults to"default"on the client. The server requires a queue on every enqueue and has no default of its own.:priority— 0 to 65535, lower runs first. Defaults to the middle of the range (32768) when not specified.:ready_at— aDateTime.t/0(or Unix milliseconds) before which the job will not run. Creates it in the:scheduledstate when set to a future date/time.:retry_limit— number of attempts before the job is declared dead.:backoff— aZizq.Backoffpolicy, or a keyword list.:retention— aZizq.Retentionpolicy, or a keyword list.:unique_key— enqueue-time deduplication key: a string, or aZizq.PayloadHasherto derive one from the payload.:payloadand{:payload, opts}are shorthand for the latter. Requires a Pro licence on the server.:unique_while—:queued(default),:active, or:exists.:batch— aZizq.BatchConfig, or a keyword list. Requires a Pro licence on the server.
Anything left unset is omitted from the request, so the server's own defaults apply and continue to track its configuration.
Summary
Functions
Build an enqueue from a keyword list or map.
Types
@type t() :: %Zizq.Enqueue{ backoff: Zizq.Backoff.t() | nil, batch: Zizq.BatchConfig.t() | nil, payload: term(), priority: non_neg_integer() | nil, queue: String.t(), ready_at: DateTime.t() | integer() | nil, retention: Zizq.Retention.t() | nil, retry_limit: non_neg_integer() | nil, type: String.t(), unique_key: String.t() | Zizq.PayloadHasher.t() | nil, unique_while: :queued | :active | :exists | nil }