Skip to main content

WorkflowContinuation

Enum WorkflowContinuation 

Source
pub enum WorkflowContinuation {
    Task {
        id: String,
        func: Option<UntypedCoreTask>,
        timeout: Option<Duration>,
        retry_policy: Option<RetryPolicy>,
        next: Option<Box<WorkflowContinuation>>,
    },
    Fork {
        id: String,
        branches: Box<[Arc<WorkflowContinuation>]>,
        join: Option<Box<WorkflowContinuation>>,
    },
    Delay {
        id: String,
        duration: Duration,
        next: Option<Box<WorkflowContinuation>>,
    },
    AwaitSignal {
        id: String,
        signal_name: String,
        timeout: Option<Duration>,
        next: Option<Box<WorkflowContinuation>>,
    },
}
Expand description

A workflow structure representing the tasks to execute.

Variants§

§

Task

Fields

§func: Option<UntypedCoreTask>

Task implementation. None for registry-based execution where tasks are looked up by id at runtime.

§timeout: Option<Duration>

Maximum time the task is allowed to run before being cancelled.

§retry_policy: Option<RetryPolicy>

Retry policy for failed task executions.

§

Fork

§

Delay

A durable delay node. Input passes through unchanged.

§

AwaitSignal

Wait for an external signal (event). Input passes through unchanged when no signal payload is provided; otherwise the signal payload becomes the input to the next step.

Fields

§signal_name: String
§timeout: Option<Duration>

Implementations§

Source§

impl WorkflowContinuation

Source

pub fn derive_fork_id(branch_ids: &[&str]) -> String

Derive a fork ID from a list of branch IDs.

The fork ID is a concatenation of branch IDs separated by ||.

Source

pub fn id(&self) -> &str

Get the ID of this continuation node.

Source

pub fn first_task_id(&self) -> &str

Get the first task ID from this continuation.

For a Task, returns its ID. For a Fork, returns the first task ID from the first branch.

Source

pub fn set_task_timeout(&mut self, target_id: &str, timeout: Option<Duration>)

Set the timeout on a specific task node found by ID.

Walks the continuation chain looking for the task with target_id and updates its timeout. Fork branches are Arc and cannot be mutated; join continuations are traversed.

Source

pub fn set_task_retry_policy( &mut self, target_id: &str, policy: Option<RetryPolicy>, )

Set the retry policy on a specific task node found by ID.

Same traversal pattern as set_task_timeout.

Source

pub fn get_task_retry_policy(&self, task_id: &str) -> Option<&RetryPolicy>

Look up the retry policy configured on a specific task by ID.

Source

pub fn get_task_timeout(&self, task_id: &str) -> Option<Duration>

Look up the timeout configured on a specific task by ID.

Recursively traverses the continuation tree (Task → Delay → Fork branches/join) to find the task and return its timeout. Used by the worker to look up a timeout from the continuation when setting a deadline.

Source

pub fn to_serializable(&self) -> SerializableContinuation

Convert to a serializable representation (strips out task implementations).

Trait Implementations§

Source§

impl ContinuationState for WorkflowContinuation

Source§

fn append(self, new_task: WorkflowContinuation) -> WorkflowContinuation

Append a new task to this continuation state, returning a WorkflowContinuation.

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.