pub struct WorkflowRuntimeBuilder<R, H> { /* private fields */ }Expand description
Builder for WorkflowRuntime.
Construct via WorkflowRuntime::builder.
Implementations§
Source§impl<R: StepRunner, H: TerminalHook> WorkflowRuntimeBuilder<R, H>
impl<R: StepRunner, H: TerminalHook> WorkflowRuntimeBuilder<R, H>
Sourcepub fn queue_name(self, name: impl Into<String>) -> Self
pub fn queue_name(self, name: impl Into<String>) -> Self
The Taquba queue name that step jobs are enqueued onto. Defaults to
"workflow-steps". Multiple runtimes can share a Queue handle by
using distinct queue names.
Sourcepub fn memo_prefix(self, prefix: impl Into<String>) -> Self
pub fn memo_prefix(self, prefix: impl Into<String>) -> Self
The object-store path prefix of the Delivery::memo
entries. Defaults to "{queue_name}-memo", so runtimes with
distinct queue names on one object store have distinct memo
namespaces.
Sourcepub fn max_concurrent_steps(self, n: usize) -> Self
pub fn max_concurrent_steps(self, n: usize) -> Self
Maximum number of steps processed concurrently in WorkflowRuntime::run.
Defaults to 16.
Sourcepub fn poll_interval(self, interval: Duration) -> Self
pub fn poll_interval(self, interval: Duration) -> Self
Maximum time the worker loop waits on an empty queue before re-checking. Defaults to 250ms. The retention sweeps run at this interval.
Sourcepub fn memo_retention(self, retention: Duration) -> Self
pub fn memo_retention(self, retention: Duration) -> Self
Enable memo retention with the given window. When set, the
runtime writes a terminal marker for every run that reaches a
terminal state, and the in-process sweeper clears that run’s memo
entries and terminal record retention after termination. When
unset (default), no marker is written and memo entries and
terminal records are retained indefinitely.
Sourcepub fn step_output_replay(self) -> Self
pub fn step_output_replay(self) -> Self
Enable content-addressed replay of runner-returned step outcomes.
When enabled, the runtime writes every StepOutcome the runner
returns, including Fail and Cancel, to object storage before
applying it. Step errors (StepError) are not
recorded, so retries still invoke the runner. The replay key is
scoped to (run_id, step_number, SHA-256(step payload)). If the
same step is delivered again after a crash before ack, the stored
outcome is replayed without invoking the runner again. The record
includes the effects staged through
Delivery::effects, so a
replayed outcome applies them as well. A replayed
StepOutcome::Continue with a Trigger::After delay reduces
the delay by the time already elapsed since the outcome was
stored, preserving the original schedule.
This is disabled by default because it adds one object-store read per step delivery (the replay lookup) plus one write per recorded outcome, and makes that write part of step settlement.
Sourcepub fn clock(self, clock: Arc<dyn Clock>) -> Self
pub fn clock(self, clock: Arc<dyn Clock>) -> Self
Override the Clock the runtime reads its timestamps from.
Defaults to the same clock the Queue was opened with (via
Queue::clock).
Sourcepub fn group_retention(self, retention: Duration) -> Self
pub fn group_retention(self, retention: Duration) -> Self
Remove a RunGroup’s state (its manifest, member records and
the memo entries and terminal records of its members) retention after a
RunGroup::results consumer observed the last member’s
termination, through a sweep when the worker starts and at every
poll interval after that. When unset (default), no group
terminal marker is written. A group whose results are never
consumed is retained until RunGroup::forget in either case.
Sourcepub fn build(self) -> WorkflowRuntime<R, H>where
H: 'static,
pub fn build(self) -> WorkflowRuntime<R, H>where
H: 'static,
Finalize the builder.
Auto Trait Implementations§
impl<R, H> !RefUnwindSafe for WorkflowRuntimeBuilder<R, H>
impl<R, H> !UnwindSafe for WorkflowRuntimeBuilder<R, H>
impl<R, H> Freeze for WorkflowRuntimeBuilder<R, H>
impl<R, H> Send for WorkflowRuntimeBuilder<R, H>
impl<R, H> Sync for WorkflowRuntimeBuilder<R, H>
impl<R, H> Unpin for WorkflowRuntimeBuilder<R, H>
impl<R, H> UnsafeUnpin for WorkflowRuntimeBuilder<R, H>where
R: UnsafeUnpin,
H: UnsafeUnpin,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);