Skip to main content

FlowConfig

Struct FlowConfig 

Source
pub struct FlowConfig { /* private fields */ }
Expand description

Overrides runtime behavior for one Flow.

StartFlow and SubFlow always select pull Workers, even when no override is supplied. crate::Client::update_flow_config leaves the Worker target unset, preserving the active Flow target. Other omitted fields use server defaults for StartFlow, inherit the parent configuration for SubFlow, and retain the active Flow setting for updates. Pass a value to crate::StartFlowOptions::config_override for one execution or to crate::Client::update_flow_config for an active Flow.

Implementations§

Source§

impl FlowConfig

Source

pub fn new() -> Self

Creates a config with no overrides.

Source

pub fn active_step_search_mode(self, value: ActiveStepSearchMode) -> Self

Controls which active Step types Dex places in the search index.

Source

pub fn attribute_store_names(self, values: Vec<String>) -> Self

Selects server-configured Attribute Stores for opted-in Attribute writes.

Omitting this builder preserves the existing Flow setting. Passing an empty vector retains protocol presence and disables later synchronization. Each enabled Attribute write is projected to every selected store; an external store failure does not roll back the Flow Attribute write.

Source

pub fn continue_as_new_threshold(self, value: u32) -> Self

Sets the event-count threshold that triggers Continue-As-New.

Source

pub fn continue_as_new_page_size_bytes(self, value: u32) -> Self

Sets the maximum history page size, in bytes, carried into Continue-As-New.

Source

pub fn step_durability(self, value: StepDurability) -> Self

Sets the default persistence durability for Step handler writes.

Source

pub fn history_window_events(self, value: u32) -> Self

Sets how many of the newest history events the run keeps, approximately.

The run uses the kept events for history reads and Time Travel. Without this builder, the run uses the server’s history.windowEvents setting, which defaults to 10000. Raise it for a run that you inspect or travel back in often. Lower it for a run that writes many events and needs less disk.

Dex prunes the oldest events in chunks, and only between commands, so a run keeps slightly more or fewer events than the value. A command that changes the Flow but records no event counts as one event. The first event of the run is always kept, so a reset to the beginning of the run always works. History reads no longer return pruned events, and Time Travel targets only commands inside the window.

Set it at start through crate::StartFlowOptions::config_override, or change it on an active Flow with crate::Client::update_flow_config. A smaller value takes effect at the run’s next pruning. A larger value keeps more of the events recorded afterwards; pruned events never come back. Once set, the value can be changed but not cleared back to the server default: an update without this builder keeps the current value. A SubFlow inherits the value from its parent unless its own crate::SubFlowOptions::config_override sets it.

The value must be positive and at most the server’s history.maxWindowEvents setting, which defaults to 100000. StartFlow and UpdateFlowConfig return crate::SdkError::Service whose crate::ServiceError::code is InvalidArgument for zero or a value above that maximum. A value above i32::MAX fails locally with crate::SdkError::InvalidArgument before any request. A Step that starts a SubFlow with an invalid override is an invalid Worker response: the Step attempt fails and Dex retries it under the Step’s retry policy. Servers older than server-zd 0.1.21 ignore the value.

client.update_flow_config(
    "order-42",
    dex_sdk::FlowConfig::new().history_window_events(50_000),
)?;

Since 1.38.0.

Trait Implementations§

Source§

impl Clone for FlowConfig

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 FlowConfig

Source§

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

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

impl Default for FlowConfig

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
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> 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<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