Struct StepOptions
pub struct StepOptions {
pub retry: RetryPolicy,
pub timeout: Option<Duration>,
pub heartbeat_timeout: Option<Duration>,
pub limit: Option<String>,
pub priority: Priority,
pub read_only: bool,
pub own_value: bool,
}Fields§
§retry: RetryPolicy§timeout: Option<Duration>Each attempt fails (and may be retried) if it runs longer than this.
heartbeat_timeout: Option<Duration>An attempt fails (and may be retried) if this long passes without a
ctx.heartbeat from it.
limit: Option<String>Take a permit of this limit before each attempt runs.
priority: PriorityWhile waiting for the limit’s permit: higher levels go first, and
steps of one level take turns by fairness key (see
crate::limits). Not journaled; the default is arrival order.
read_only: boolThe step only reads: its function changes nothing outside the
process, so it may run before the records ahead of it are durable
(it skips its gate). A crash can then make it run again with
different inputs, which is harmless for a read and wrong for anything
else. Its result is recorded like any step’s, and later steps and
outputs still wait for it to be durable. Ignored by
await_completion.
own_value: boolA live attempt’s result is returned as the step function produced it
instead of decoded from the JSON recorded for it (replay still
decodes). Saves the decode, about 4% of a memory step, but code
then sees, for a type whose JSON round trip loses something, what
replay would not give it. Off by default.
Implementations§
§impl StepOptions
impl StepOptions
pub fn retry(self, retry: RetryPolicy) -> Self
pub fn timeout(self, timeout: Duration) -> Self
pub fn heartbeat_timeout(self, timeout: Duration) -> Self
pub fn limit(self, name: &str) -> Self
pub fn limit_by(self, name: &str, key: &str) -> Self
pub fn limit_by(self, name: &str, key: &str) -> Self
A limit per key: the permits of name for this key only (a
tenant, an account), each key with the size engine.limit(name, …)
gives, made on first use.
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 (default 0).
pub fn fairness(self, key: &str) -> Self
pub fn fairness(self, key: &str) -> Self
Steps waiting for the limit’s permit at one level take turns by this key (a tenant ID, say), so a key with a deep backlog cannot starve the others.
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).
Trait Implementations§
§impl Clone for StepOptions
impl Clone for StepOptions
§fn clone(&self) -> StepOptions
fn clone(&self) -> StepOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more