pub trait AgentSpawner: Send + Sync {
// Required methods
fn spawn_agent<'life0, 'async_trait>(
&'life0 self,
id: String,
name: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn send_event<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
payload: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn load_state<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn shutdown_all<'life0, 'async_trait>(
&'life0 self,
grace_secs: u64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn spawn_agent_with_request<'life0, 'async_trait>(
&'life0 self,
request: AgentSpawnRequest,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Trait for spawning and managing isolated agents
Required Methods§
Sourcefn spawn_agent<'life0, 'async_trait>(
&'life0 self,
id: String,
name: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn spawn_agent<'life0, 'async_trait>(
&'life0 self,
id: String,
name: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Spawn an agent and return its id
Sourcefn send_event<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
payload: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_event<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
payload: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send an event envelope to a running agent
Provided Methods§
Sourcefn spawn_agent_with_request<'life0, 'async_trait>(
&'life0 self,
request: AgentSpawnRequest,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn spawn_agent_with_request<'life0, 'async_trait>(
&'life0 self,
request: AgentSpawnRequest,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Spawn an agent with an explicit request payload.