Skip to main content

EngineHandle

Trait EngineHandle 

Source
pub trait EngineHandle: Send + Sync {
    // Required methods
    fn resolve_workflow(
        &self,
        workflow_id: &WorkflowId,
    ) -> Result<WorkflowResidency, EngineSeamError>;
    fn deliver_workflow_message(
        &self,
        process: WorkflowProcessHandle,
        message: WorkflowMailboxMessage,
    ) -> Result<(), EngineSeamError>;
    fn spawn_child_workflow(
        &self,
        request: ChildWorkflowSpawnRequest,
    ) -> Result<ChildWorkflowSpawnResult, EngineSeamError>;
    fn terminate_linked_child_workflow(
        &self,
        parent_workflow_id: &WorkflowId,
        child_process: WorkflowProcessHandle,
        correlation: u64,
    ) -> Result<(), EngineSeamError>;
    fn terminate_linked_activity(
        &self,
        parent_workflow_id: &WorkflowId,
        activity_process: Pid,
        correlation: u64,
    ) -> Result<(), EngineSeamError>;
    fn arm_timer(&self, entry: TimerWheelEntry) -> Result<(), EngineSeamError>;
    fn disarm_timer(
        &self,
        process: WorkflowProcessHandle,
        timer_id: &TimerId,
    ) -> Result<(), EngineSeamError>;
    fn record_workflow_event(
        &self,
        workflow_id: &WorkflowId,
        event: Event,
    ) -> Result<RecordOutcome, EngineSeamError>;
}
Expand description

Engine-facing capabilities consumed by AT services and implemented by AE.

This trait deliberately does not expose operations that start, supervise, tear down, or load top-level workflow processes. Child spawning, residency resolution, and recording are requests into AE/AD-owned infrastructure. In particular, EngineHandle::record_workflow_event must route asynchronous-arrival events through the target workflow’s single Recorder; AT services must not append directly to the event store.

Required Methods§

Source

fn resolve_workflow( &self, workflow_id: &WorkflowId, ) -> Result<WorkflowResidency, EngineSeamError>

Resolves a workflow identifier to its current residency state.

§Errors

Returns EngineSeamError when AE cannot inspect residency for the requested workflow.

Source

fn deliver_workflow_message( &self, process: WorkflowProcessHandle, message: WorkflowMailboxMessage, ) -> Result<(), EngineSeamError>

Delivers a message to a resident workflow process mailbox.

§Errors

Returns EngineSeamError when AE cannot enqueue the message on the target mailbox.

Source

fn spawn_child_workflow( &self, request: ChildWorkflowSpawnRequest, ) -> Result<ChildWorkflowSpawnResult, EngineSeamError>

Requests AE to spawn a child workflow execution linked to the parent process.

§Errors

Returns EngineSeamError when AE rejects or fails the linked child-spawn request.

Source

fn terminate_linked_child_workflow( &self, parent_workflow_id: &WorkflowId, child_process: WorkflowProcessHandle, correlation: u64, ) -> Result<(), EngineSeamError>

Terminates a linked child workflow process through AE’s process-link boundary.

§Errors

Returns EngineSeamError when AE cannot send the cancellation exit to the linked child.

Source

fn terminate_linked_activity( &self, parent_workflow_id: &WorkflowId, activity_process: Pid, correlation: u64, ) -> Result<(), EngineSeamError>

Terminates a linked in-VM activity process through AE’s process-link boundary.

§Errors

Returns EngineSeamError when AE cannot send the cancellation exit to the linked child.

Source

fn arm_timer(&self, entry: TimerWheelEntry) -> Result<(), EngineSeamError>

Arms a timer-wheel entry for a resident workflow process.

§Errors

Returns EngineSeamError when AE cannot register the timer with the live wheel.

Source

fn disarm_timer( &self, process: WorkflowProcessHandle, timer_id: &TimerId, ) -> Result<(), EngineSeamError>

Disarms a timer-wheel entry for a resident workflow process.

§Errors

Returns EngineSeamError when AE cannot remove the timer from the live wheel.

Source

fn record_workflow_event( &self, workflow_id: &WorkflowId, event: Event, ) -> Result<RecordOutcome, EngineSeamError>

Records an event through the target workflow’s single AD Recorder.

Returns RecordOutcome::Recorded when the event was durably appended, or RecordOutcome::RefusedTerminal when the append was declined because the active run already recorded a terminal (a benign late arrival). Callers that follow a recorded fire with a mailbox wake MUST gate the wake on Recorded — a RefusedTerminal fire must not reschedule a terminated workflow.

§Errors

Returns EngineSeamError when the target workflow’s Recorder cannot append the event.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§