Skip to main content

EnqueueOptions

Struct EnqueueOptions 

Source
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>,
    pub concurrency_limits: Vec<ConcurrencyLimit>,
    pub priority: Option<i16>,
    pub worker_tags: Vec<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: u32

Number 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.

§concurrency_limits: Vec<ConcurrencyLimit>

Concurrency groups the run belongs to, each with the maximum number of root runs of that group allowed to execute at once.

Unlike concurrency_key, the run is always created: it stays pending until every group is under its limit. Empty means no limit. Invalid limits are refused with EngineError::InvalidConcurrencyLimit.

§priority: Option<i16>

Queue priority of the run, overriding WorkflowHandler::priority.

Workers pick the pending run with the highest priority first, then the oldest among equal priorities. None falls back to the handler’s priority, clamped to the accepted range. An explicit value outside MIN_PRIORITY..=MAX_PRIORITY is refused with EngineError::InvalidPriority.

§worker_tags: Vec<String>

Worker tags the run requires, merged with the handler’s required_worker_tags.

Only a worker carrying every tag picks the run. Invalid tags are refused with EngineError::InvalidWorkerTag.

Trait Implementations§

Source§

impl Clone for EnqueueOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EnqueueOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EnqueueOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more