Skip to main content

ExecutionSession

Trait ExecutionSession 

Source
pub trait ExecutionSession: Send {
    // Required methods
    fn pid(&self) -> u32;
    fn execute<'a>(
        &'a mut self,
        invocation: RuntimeInvocation,
        control: RunControl,
    ) -> PortFuture<'a, ProgramOutcome>;
    fn close(&mut self) -> PortFuture<'_, ()>;

    // Provided method
    fn execute_with_requests<'a>(
        &'a mut self,
        _invocation: RuntimeInvocation,
        _control: RunControl,
        _handler: Arc<dyn RuntimeRequestHandler>,
    ) -> PortFuture<'a, ProgramOutcome> { ... }
}

Required Methods§

Source

fn pid(&self) -> u32

Source

fn execute<'a>( &'a mut self, invocation: RuntimeInvocation, control: RunControl, ) -> PortFuture<'a, ProgramOutcome>

Runtime/protocol errors require retiring the session; business Failure may be reused. The session must retain process ownership if this future is dropped or panics, so close can still confirm cleanup. Adapter panics close worker admission.

Source

fn close(&mut self) -> PortFuture<'_, ()>

Resolves successfully only once the process group is stopped and child reaped. Calls must be retryable after cancellation or failure, retaining confirmed cleanup progress and the artifact pin until cleanup is complete.

Provided Methods§

Source

fn execute_with_requests<'a>( &'a mut self, _invocation: RuntimeInvocation, _control: RunControl, _handler: Arc<dyn RuntimeRequestHandler>, ) -> PortFuture<'a, ProgramOutcome>

Opt-in execution with intermediate request/reply exchanges. Unsupported runtimes reject this explicitly without executing the program. The same process ownership and cleanup obligations as execute apply; callback failure, cancellation, or an uncertain exchange must retire the session.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§