Skip to main content

LifecycleController

Trait LifecycleController 

Source
pub trait LifecycleController {
    // Required methods
    fn initialize_agent<'life0, 'async_trait>(
        &'life0 self,
        config: AgentConfig,
    ) -> Pin<Box<dyn Future<Output = Result<AgentId, LifecycleError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn start_agent<'life0, 'async_trait>(
        &'life0 self,
        agent_id: AgentId,
    ) -> Pin<Box<dyn Future<Output = Result<(), LifecycleError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn suspend_agent<'life0, 'async_trait>(
        &'life0 self,
        agent_id: AgentId,
    ) -> Pin<Box<dyn Future<Output = Result<(), LifecycleError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn resume_agent<'life0, 'async_trait>(
        &'life0 self,
        agent_id: AgentId,
    ) -> Pin<Box<dyn Future<Output = Result<(), LifecycleError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn terminate_agent<'life0, 'async_trait>(
        &'life0 self,
        agent_id: AgentId,
    ) -> Pin<Box<dyn Future<Output = Result<(), LifecycleError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_agent_state<'life0, 'async_trait>(
        &'life0 self,
        agent_id: AgentId,
    ) -> Pin<Box<dyn Future<Output = Result<AgentState, LifecycleError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_agents_by_state<'life0, 'async_trait>(
        &'life0 self,
        state: AgentState,
    ) -> Pin<Box<dyn Future<Output = Vec<AgentId>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn shutdown<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), LifecycleError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn check_health<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<ComponentHealth, LifecycleError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Agent lifecycle controller trait

Required Methods§

Source

fn initialize_agent<'life0, 'async_trait>( &'life0 self, config: AgentConfig, ) -> Pin<Box<dyn Future<Output = Result<AgentId, LifecycleError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Initialize a new agent

Source

fn start_agent<'life0, 'async_trait>( &'life0 self, agent_id: AgentId, ) -> Pin<Box<dyn Future<Output = Result<(), LifecycleError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Start an agent

Source

fn suspend_agent<'life0, 'async_trait>( &'life0 self, agent_id: AgentId, ) -> Pin<Box<dyn Future<Output = Result<(), LifecycleError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Suspend an agent

Source

fn resume_agent<'life0, 'async_trait>( &'life0 self, agent_id: AgentId, ) -> Pin<Box<dyn Future<Output = Result<(), LifecycleError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Resume a suspended agent

Source

fn terminate_agent<'life0, 'async_trait>( &'life0 self, agent_id: AgentId, ) -> Pin<Box<dyn Future<Output = Result<(), LifecycleError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Terminate an agent

Source

fn get_agent_state<'life0, 'async_trait>( &'life0 self, agent_id: AgentId, ) -> Pin<Box<dyn Future<Output = Result<AgentState, LifecycleError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get agent state

Source

fn get_agents_by_state<'life0, 'async_trait>( &'life0 self, state: AgentState, ) -> Pin<Box<dyn Future<Output = Vec<AgentId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all agents in a specific state

Source

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

Shutdown the lifecycle controller

Source

fn check_health<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ComponentHealth, LifecycleError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check the health of the lifecycle controller

Implementors§