Struct Op
pub struct Op<O, M: Make<O>> { /* private fields */ }Expand description
An operation with options O, set by its builder methods, that runs
when awaited: ctx.step("charge", f).retry(policy).await.
Implementations§
§impl<M: Make<StepOptions>> Op<StepOptions, M>
impl<M: Make<StepOptions>> Op<StepOptions, M>
pub fn own_value(self) -> Self
pub fn own_value(self) -> Self
pub fn retry(self, retry: RetryPolicy) -> Self
pub fn retry(self, retry: RetryPolicy) -> Self
How failures are retried (default: RetryPolicy::default).
pub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Each attempt fails (and may be retried) if it runs longer than this.
pub fn heartbeat_timeout(self, timeout: Duration) -> Self
pub fn heartbeat_timeout(self, timeout: Duration) -> Self
An attempt fails if this long passes without a ctx.heartbeat.
pub fn read_only(self) -> Self
pub fn read_only(self) -> Self
The step only reads: it may run before the records ahead of it are
durable (see StepOptions::read_only).
pub fn limit_by(self, name: &str, key: &str) -> Self
pub fn limit_by(self, name: &str, key: &str) -> Self
Takes a permit of name for this key only: each key (a tenant, an
account) has its own permits, of the size engine.limit(name, …)
gives, made on first use.
ctx.step("sync", || api.sync(&tenant)).limit_by("tenant", &tenant).await?;pub fn priority(self, level: i32) -> Self
pub fn priority(self, level: i32) -> Self
Waits for the limit’s permit ahead of steps with a lower level.
pub fn fairness_weight(self, weight: u32) -> Self
pub fn fairness_weight(self, weight: u32) -> Self
Permits the fairness key takes per turn (default 1).
§impl<M: Make<WaitOptions>> Op<WaitOptions, M>
impl<M: Make<WaitOptions>> Op<WaitOptions, M>
§impl<M: Make<ChildOptions>> Op<ChildOptions, M>
impl<M: Make<ChildOptions>> Op<ChildOptions, M>
pub fn parent_close(self, close: ParentClose) -> Self
pub fn parent_close(self, close: ParentClose) -> Self
What happens to the child when this workflow closes.
§impl<M: Make<StartOptions>> Op<StartOptions, M>
Options of a start (see Engine::start).
impl<M: Make<StartOptions>> Op<StartOptions, M>
Options of a start (see Engine::start).
pub fn use_existing(self) -> Self
pub fn use_existing(self) -> Self
Attaches to a run of this ID that is still going (a client that retries a start should).
pub fn delay(self, delay: Duration) -> Self
pub fn delay(self, delay: Duration) -> Self
Starts the run after delay instead of now: a durable timer, then
the start (crate::delay). result() waits through the delay.
pub fn at(self, at: SystemTime) -> Self
pub fn at(self, at: SystemTime) -> Self
Starts the run at at instead of now (delay).
pub fn trace(self, traceparent: impl Into<String>) -> Self
pub fn trace(self, traceparent: impl Into<String>) -> Self
The W3C traceparent the run joins (StartOptions::trace).
pub fn concurrency_key(self, key: impl Into<String>) -> Self
pub fn concurrency_key(self, key: impl Into<String>) -> Self
The key a limit on runs at once counts by (StartOptions::concurrency_key).
§impl<M: Make<EventOptions>> Op<EventOptions, M>
impl<M: Make<EventOptions>> Op<EventOptions, M>
§impl<M: Make<UpdateOptions>> Op<UpdateOptions, M>
impl<M: Make<UpdateOptions>> Op<UpdateOptions, M>
pub fn id(self, id: &str) -> Self
pub fn start_options(self, start: StartOptions) -> Self
pub fn start_options(self, start: StartOptions) -> Self
For update-with-start: the start’s options.