Skip to main content

LiveExecutor

Trait LiveExecutor 

Source
pub trait LiveExecutor: Send + Sync {
    // Required methods
    fn run_activity<'life0, 'async_trait>(
        &'life0 self,
        activity_type: String,
        input: Payload,
    ) -> Pin<Box<dyn Future<Output = Result<LiveActivityOutcome, DurabilityError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn start_timer<'life0, 'async_trait>(
        &'life0 self,
        timer_id: TimerId,
        fire_at: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<(), DurabilityError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn await_signal<'life0, 'async_trait>(
        &'life0 self,
        name: String,
        index: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Payload, DurabilityError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn spawn_child<'life0, 'async_trait>(
        &'life0 self,
        workflow_type: String,
        input: Payload,
    ) -> Pin<Box<dyn Future<Output = Result<LiveChildOutcome, DurabilityError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

AE-provided live side-effect executor.

AD owns replay, the resolver, and event recording. AE owns actual world interaction (activity dispatch, timer wheel/durable timer scheduling, signal wait plumbing, and child workflow process management) and supplies an object-safe implementation of this trait, such as a beamr-backed executor, without AD depending on those runtime crates.

AD calls these methods only after Resolver returns ResolveOutcome::ResumeLive. While recorded history can satisfy a command, the executor must not be touched. Command-issued events are recorded by resolve_or_execute_live through the single per-workflow Recorder: activity scheduled/started/outcome, timer started, child workflow started, and workflow completed. Asynchronous arrival events that are not workflow-issued commands (TimerFired, SignalReceived, ChildWorkflowCompleted, and ChildWorkflowFailed) are recorded by AT/AE services when they occur, but still through that same recorder instance so the recorder remains the only sequence-head authority.

Required Methods§

Source

fn run_activity<'life0, 'async_trait>( &'life0 self, activity_type: String, input: Payload, ) -> Pin<Box<dyn Future<Output = Result<LiveActivityOutcome, DurabilityError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Runs an activity for real at the resume-live point.

§Errors

Returns a durability error when the live runtime cannot produce a recordable outcome.

Source

fn start_timer<'life0, 'async_trait>( &'life0 self, timer_id: TimerId, fire_at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<(), DurabilityError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Starts or awaits a timer for real at the resume-live point.

The AE implementation arms runtime timer machinery and persists any durable timer row; AD records only the command-issued TimerStarted history event.

§Errors

Returns a durability error when the live runtime cannot start or await the timer.

Source

fn await_signal<'life0, 'async_trait>( &'life0 self, name: String, index: usize, ) -> Pin<Box<dyn Future<Output = Result<Payload, DurabilityError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Awaits a signal for real at the resume-live point.

§Errors

Returns a durability error when the live runtime cannot deliver a signal payload.

Source

fn spawn_child<'life0, 'async_trait>( &'life0 self, workflow_type: String, input: Payload, ) -> Pin<Box<dyn Future<Output = Result<LiveChildOutcome, DurabilityError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Spawns and awaits a child workflow for real at the resume-live point.

§Errors

Returns a durability error when the live runtime cannot produce a recordable child outcome.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§