Skip to main content

WorkflowHost

Trait WorkflowHost 

Source
pub trait WorkflowHost: Send + Sync {
    // Required methods
    fn service(
        &self,
        catalog: ToolCatalog,
        retry: RetryPolicy,
    ) -> Result<Arc<dyn CodeModeService>, String>;
    fn database(
        &self,
        kind: WorkflowDatabaseKind,
    ) -> Result<Arc<dyn WorkflowDatabase>, String>;
    fn fixture_service(
        &self,
        connectors: Vec<Arc<dyn Connector>>,
    ) -> Result<Arc<dyn CodeModeService>, String>;
    fn sleep<'life0, 'async_trait>(
        &'life0 self,
        milliseconds: u64,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn service_with_limits(
        &self,
        catalog: ToolCatalog,
        retry: RetryPolicy,
        limits: WorkflowLimits,
    ) -> Result<Arc<dyn CodeModeService>, String> { ... }
    fn wake_at<'life0, 'async_trait>(
        &'life0 self,
        _timestamp: u64,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn read_fixture(&self, source: &str) -> Result<Vec<u8>, String> { ... }
}
Expand description

Host capabilities required by the shared workflow commands.

Hosts own a tenant’s execution and database lifetime. The catalog supplied to service excludes lifecycle commands; callable workflow composition uses the shared runtime.

Required Methods§

Source

fn service( &self, catalog: ToolCatalog, retry: RetryPolicy, ) -> Result<Arc<dyn CodeModeService>, String>

Opens the execution service with isolated host-call options and this retry policy.

Source

fn database( &self, kind: WorkflowDatabaseKind, ) -> Result<Arc<dyn WorkflowDatabase>, String>

Supplies durable SQL storage for the selected workflow subsystem.

Source

fn fixture_service( &self, connectors: Vec<Arc<dyn Connector>>, ) -> Result<Arc<dyn CodeModeService>, String>

Creates an isolated executor that can invoke only these fixture connectors.

Source

fn sleep<'life0, 'async_trait>( &'life0 self, milliseconds: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Waits without using a process runtime timer.

Provided Methods§

Source

fn service_with_limits( &self, catalog: ToolCatalog, retry: RetryPolicy, limits: WorkflowLimits, ) -> Result<Arc<dyn CodeModeService>, String>

Opens a service with host-owned composition budgets; older adapters reject custom limits.

Source

fn wake_at<'life0, 'async_trait>( &'life0 self, _timestamp: u64, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Persists a wakeup no later than this Unix millisecond timestamp. Hosts that poll independently may keep the default implementation.

Source

fn read_fixture(&self, source: &str) -> Result<Vec<u8>, String>

Loads a fixture. Hosts without files accept the fixture JSON directly.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§