pub struct StartFlowOptions { /* private fields */ }Expand description
Configures a new Flow execution.
All optional fields are absent by default. Initial Attribute values are encoded when the start request is sent. Use a stable request ID to make retries of the same logical request idempotent.
§Examples
use dex_sdk::{Attribute, IdReusePolicy, StartFlowOptions};
use std::time::Duration;
let customer = Attribute::<String>::new("customer");
let options = StartFlowOptions::new()
.timeout(Duration::from_secs(3_600))
.id_reuse_policy(IdReusePolicy::AllowIfNotRunning)
.initial_attribute(&customer, "customer-42".to_owned())
.request_id("create-order-42");Implementations§
Source§impl StartFlowOptions
impl StartFlowOptions
Sourcepub fn timeout(self, value: Duration) -> Self
pub fn timeout(self, value: Duration) -> Self
Sets Dex’s durable soft timeout. A zero duration disables it.
Sourcepub fn timeout_policy(self, value: FlowTimeoutPolicy) -> Self
pub fn timeout_policy(self, value: FlowTimeoutPolicy) -> Self
Sets the action taken when the positive Flow timeout expires.
Handler is rejected before start when the registered Flow has no timeout handler.
Sourcepub fn start_delay(self, value: Duration) -> Self
pub fn start_delay(self, value: Duration) -> Self
Delays the first Step after the server accepts the Flow.
Sourcepub fn id_reuse_policy(self, value: IdReusePolicy) -> Self
pub fn id_reuse_policy(self, value: IdReusePolicy) -> Self
Sets how the server handles an existing Flow with the same ID.
Sourcepub fn retry_policy(self, value: RetryPolicy) -> Self
pub fn retry_policy(self, value: RetryPolicy) -> Self
Sets the whole-Flow retry policy after a terminal failure.
Sourcepub fn initial_attribute<T: Value>(
self,
attribute: &Attribute<T>,
value: T,
) -> Self
pub fn initial_attribute<T: Value>( self, attribute: &Attribute<T>, value: T, ) -> Self
Adds an initial value for a declared Attribute.
Sourcepub fn initial_attribute_map<T: Value>(
self,
attribute: &AttributeMap<T>,
instance: &str,
value: T,
) -> Self
pub fn initial_attribute_map<T: Value>( self, attribute: &AttributeMap<T>, instance: &str, value: T, ) -> Self
Adds an initial value for one Attribute-map instance.
Sourcepub fn config_override(self, value: FlowConfig) -> Self
pub fn config_override(self, value: FlowConfig) -> Self
Overrides the registered Flow configuration for this execution.
Sourcepub fn ignore_already_started(self, value: bool) -> Self
pub fn ignore_already_started(self, value: bool) -> Self
Returns the existing run ID instead of an error when the Flow already exists.
Sourcepub fn request_id(self, value: impl Into<String>) -> Self
pub fn request_id(self, value: impl Into<String>) -> Self
Sets the idempotency key for this start request.
Trait Implementations§
Source§impl Clone for StartFlowOptions
impl Clone for StartFlowOptions
Source§fn clone(&self) -> StartFlowOptions
fn clone(&self) -> StartFlowOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for StartFlowOptions
impl !UnwindSafe for StartFlowOptions
impl Freeze for StartFlowOptions
impl Send for StartFlowOptions
impl Sync for StartFlowOptions
impl Unpin for StartFlowOptions
impl UnsafeUnpin for StartFlowOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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