pub struct AgentLifecycleManager { /* private fields */ }Expand description
Manages the full lifecycle of a single agent from fork to cleanup.
Implementations§
Source§impl AgentLifecycleManager
impl AgentLifecycleManager
Sourcepub fn new(
supervisor: Arc<dyn Supervisor>,
scheduler: Arc<AgentScheduler>,
access_manager: Arc<Mutex<AccessManager>>,
a2a: Arc<A2AProtocol>,
event_bus: EventBus,
max_execution_time_secs: u64,
) -> Self
pub fn new( supervisor: Arc<dyn Supervisor>, scheduler: Arc<AgentScheduler>, access_manager: Arc<Mutex<AccessManager>>, a2a: Arc<A2AProtocol>, event_bus: EventBus, max_execution_time_secs: u64, ) -> Self
Create a new lifecycle manager.
Sourcepub fn set_max_execution_time(&self, secs: u64)
pub fn set_max_execution_time(&self, secs: u64)
Hot-reload max execution time without restart.
Sourcepub async fn spawn_and_run(
&self,
seed: &Seed,
priority: Priority,
) -> Result<ExecutionResult>
pub async fn spawn_and_run( &self, seed: &Seed, priority: Priority, ) -> Result<ExecutionResult>
Fork an agent, register it in A2A and access control, submit to scheduler, run the seed, then clean up.
Sourcepub async fn terminate(&self, agent_id: AgentId) -> Result<()>
pub async fn terminate(&self, agent_id: AgentId) -> Result<()>
Kill an agent and clean up all registered state.
Sourcepub fn reap_zombies(&self) -> Vec<Uuid>
pub fn reap_zombies(&self) -> Vec<Uuid>
Reap finished zombie tasks and log the cleanup.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AgentLifecycleManager
impl !RefUnwindSafe for AgentLifecycleManager
impl !UnwindSafe for AgentLifecycleManager
impl Send for AgentLifecycleManager
impl Sync for AgentLifecycleManager
impl Unpin for AgentLifecycleManager
impl UnsafeUnpin for AgentLifecycleManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more