pub struct StepOptions<Input> { /* private fields */ }Expand description
Configures one Step’s handler execution and persistence behavior.
New options preserve server timeout, retry, and durability defaults. wait_for failures fail the
Flow by default. Attribute locks apply only to the matching handler call. The type system checks
that an execute-failure recovery Step accepts the same input type.
§Examples
use dex_sdk::{Attribute, RetryPolicy, StepOptions, WaitForFailurePolicy};
use std::time::Duration;
let balance = Attribute::<i64>::new("balance");
let options = StepOptions::<String>::new()
.execute_method_timeout(Duration::from_secs(30))
.execute_retry(RetryPolicy::new().maximum_attempts(3))
.wait_for_failure(WaitForFailurePolicy::Proceed)
.execute_lock(balance.lock());Implementations§
Source§impl<Input: Value> StepOptions<Input>
impl<Input: Value> StepOptions<Input>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates options that preserve server defaults and fail on exhausted wait_for retries.
Sourcepub fn wait_for_method_timeout(self, value: Duration) -> Self
pub fn wait_for_method_timeout(self, value: Duration) -> Self
Sets the maximum duration of one wait_for handler attempt.
Sourcepub fn execute_method_timeout(self, value: Duration) -> Self
pub fn execute_method_timeout(self, value: Duration) -> Self
Sets the maximum duration of one execute handler attempt.
Sourcepub fn heartbeat_timeout(self, value: Duration) -> Self
pub fn heartbeat_timeout(self, value: Duration) -> Self
Sets the heartbeat timeout for regular wait_for and execute activities.
Zero selects the server default of one minute. Positive values must be whole seconds and at least the server-configured minimum, which defaults to ten seconds. Local activities ignore this option; an asynchronous fallback to a regular activity uses it.
Sourcepub fn wait_for_retry(self, value: RetryPolicy) -> Self
pub fn wait_for_retry(self, value: RetryPolicy) -> Self
Sets the retry policy for failed wait_for attempts.
Sourcepub fn execute_retry(self, value: RetryPolicy) -> Self
pub fn execute_retry(self, value: RetryPolicy) -> Self
Sets the retry policy for failed execute attempts.
Sourcepub fn wait_for_failure(self, value: WaitForFailurePolicy) -> Self
pub fn wait_for_failure(self, value: WaitForFailurePolicy) -> Self
Selects whether exhausted wait_for retries fail or advance the Flow.
Sourcepub fn on_execute_failure_proceed_to<RecoveryStep>(
self,
step: &RecoveryStep,
) -> Selfwhere
RecoveryStep: Step<Input = Input>,
pub fn on_execute_failure_proceed_to<RecoveryStep>(
self,
step: &RecoveryStep,
) -> Selfwhere
RecoveryStep: Step<Input = Input>,
Routes exhausted execute failures to a recovery Step with the same input type.
Sourcepub fn wait_for_durability(self, value: StepDurability) -> Self
pub fn wait_for_durability(self, value: StepDurability) -> Self
Overrides persistence durability for writes staged by wait_for.
Sourcepub fn execute_durability(self, value: StepDurability) -> Self
pub fn execute_durability(self, value: StepDurability) -> Self
Overrides persistence durability for writes staged by execute.
Sourcepub fn wait_for_lock(self, value: AttributeLock) -> Self
pub fn wait_for_lock(self, value: AttributeLock) -> Self
Adds an Attribute lock held for the wait_for invocation.
Sourcepub fn execute_lock(self, value: AttributeLock) -> Self
pub fn execute_lock(self, value: AttributeLock) -> Self
Adds an Attribute lock held for the execute invocation.
Sourcepub fn wait_for_load_attribute_map<T>(
self,
attribute_map: &AttributeMap<T>,
) -> Self
pub fn wait_for_load_attribute_map<T>( self, attribute_map: &AttributeMap<T>, ) -> Self
Loads every current instance of attribute_map for wait_for.
Sourcepub fn wait_for_load_attribute_map_instance(
self,
load: AttributeMapLoad,
) -> Self
pub fn wait_for_load_attribute_map_instance( self, load: AttributeMapLoad, ) -> Self
Loads one AttributeMap instance for wait_for.
Sourcepub fn wait_for_load_channel<T>(self, channel: &Channel<T>) -> Self
pub fn wait_for_load_channel<T>(self, channel: &Channel<T>) -> Self
Loads one Channel’s pending messages for wait_for.
Sourcepub fn wait_for_load_channel_map<T>(self, channel_map: &ChannelMap<T>) -> Self
pub fn wait_for_load_channel_map<T>(self, channel_map: &ChannelMap<T>) -> Self
Loads every current ChannelMap instance’s pending messages for wait_for.
Sourcepub fn wait_for_load_channel_map_instance(self, load: ChannelMapLoad) -> Self
pub fn wait_for_load_channel_map_instance(self, load: ChannelMapLoad) -> Self
Loads one ChannelMap instance’s pending messages for wait_for.
Sourcepub fn execute_load_attribute_map<T>(
self,
attribute_map: &AttributeMap<T>,
) -> Self
pub fn execute_load_attribute_map<T>( self, attribute_map: &AttributeMap<T>, ) -> Self
Loads every current instance of attribute_map for execute.
Sourcepub fn execute_load_attribute_map_instance(self, load: AttributeMapLoad) -> Self
pub fn execute_load_attribute_map_instance(self, load: AttributeMapLoad) -> Self
Loads one AttributeMap instance for execute.
Sourcepub fn execute_load_channel<T>(self, channel: &Channel<T>) -> Self
pub fn execute_load_channel<T>(self, channel: &Channel<T>) -> Self
Loads one Channel’s pending messages for execute.
Sourcepub fn execute_load_channel_map<T>(self, channel_map: &ChannelMap<T>) -> Self
pub fn execute_load_channel_map<T>(self, channel_map: &ChannelMap<T>) -> Self
Loads every current ChannelMap instance’s pending messages for execute.
Sourcepub fn execute_load_channel_map_instance(self, load: ChannelMapLoad) -> Self
pub fn execute_load_channel_map_instance(self, load: ChannelMapLoad) -> Self
Loads one ChannelMap instance’s pending messages for execute.
Trait Implementations§
Auto Trait Implementations§
impl<Input> Freeze for StepOptions<Input>
impl<Input> RefUnwindSafe for StepOptions<Input>
impl<Input> Send for StepOptions<Input>
impl<Input> Sync for StepOptions<Input>
impl<Input> Unpin for StepOptions<Input>
impl<Input> UnsafeUnpin for StepOptions<Input>
impl<Input> UnwindSafe for StepOptions<Input>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request