pub struct EnqueueOptions {
pub max_retries: u32,
pub labels: HashMap<String, String>,
pub scheduled_at: Option<DateTime<Utc>>,
pub max_cost_usd: Option<Decimal>,
pub created_by: Option<RunActor>,
pub idempotency_key: Option<String>,
pub concurrency_key: Option<String>,
}Expand description
Optional settings for Engine::enqueue_handler_with_options.
All fields fall back to handler or server defaults when left at their
Default value.
§Examples
use ironflow_engine::engine::EnqueueOptions;
use rust_decimal::Decimal;
let options = EnqueueOptions {
max_retries: 3,
max_cost_usd: Some(Decimal::new(50, 2)),
..Default::default()
};
assert_eq!(options.max_retries, 3);Fields§
§max_retries: u32Number of automatic retries granted to the run.
labels: HashMap<String, String>Labels merged on top of the handler’s default labels.
scheduled_at: Option<DateTime<Utc>>Defer execution until this instant instead of running as soon as a worker picks the run up.
max_cost_usd: Option<Decimal>Cost cap for the run. Overrides both the handler default and the server
default. None falls back to
BudgetConfig::resolve_run_cap.
created_by: Option<RunActor>Authenticated principal that triggered the run. None for cron,
webhook, and programmatic triggers.
idempotency_key: Option<String>Idempotency key binding this enqueue to a single run.
When set and already bound to a run created within
IDEMPOTENCY_WINDOW,
nothing is enqueued and the original run is replayed.
concurrency_key: Option<String>Concurrency key making the run exclusive.
When set, the run is refused with EngineError::ConcurrencyConflict
while another non-terminal run holds the same key. The key is released
once the holder reaches a terminal state.