Expand description
Derive macros for queuey.
Queuesimplementsqueuey_core::QueueSetfor a fieldless enum.Jobimplementsqueuey_core::Jobfor a serializable payload type.
§Where the generated code points
Generated code needs a path to queuey-core. Both macros work that
out from the calling crate’s Cargo.toml (via proc-macro-crate):
- a dependency on
queuey(the facade), which emits::queuey::__core, its hidden re-export of the core crate; - otherwise a dependency on
queuey-core, which emits::queuey_core; - otherwise it falls back to
::queuey_core.
Renamed dependencies (aq = { package = "queuey" }) are handled. For
anything else (a vendored copy, a re-export under yet another name) say so
explicitly with #[queues(crate = "...")] / #[job(crate = "...")], which
always wins.
§Duration literals
Every duration in these attributes is a string literal parsed while the macro
runs: an integer followed by an optional unit of ms, s, m, h or d.
A bare integer means seconds. Whitespace is ignored, so "500ms", "30s",
"2 m" and "30" are all valid. Anything else is a compile error pointing at
the literal. Zero is rejected everywhere a duration is accepted: a zero
message_ttl discards every message on publish, and a zero backoff is
spelled backoff = "none".
§retry(...) grammar
Shared by #[queue(...)] and #[job(...)]:
retry(
max_attempts = 3, // u32 >= 1, default 3 (1 means no retries)
backoff = "exponential", // "none" | "fixed" | "exponential", default "exponential"
delay = "1s", // fixed only, required for "fixed"
base = "1s", // exponential only, default "1s", must be <= max
factor = 2.0, // exponential only, default 2.0, must be > 0
max = "5m", // exponential only, default "5m"
jitter = true, // exponential only, default true
)The exponential defaults match queuey_core::Backoff::exponential().