pub struct AgentHandle {
pub process_id: ProcessId,
pub provider: Provider,
/* private fields */
}Expand description
Handle to a spawned agent process
Fields§
§process_id: ProcessIdProcess ID
provider: ProviderProvider configuration
Implementations§
Source§impl AgentHandle
impl AgentHandle
Sourcepub fn process_id(&self) -> ProcessId
pub fn process_id(&self) -> ProcessId
Get the process ID
Sourcepub async fn is_healthy(&self) -> bool
pub async fn is_healthy(&self) -> bool
Check if the agent is healthy
Sourcepub fn health_status(&self) -> HealthStatus
pub fn health_status(&self) -> HealthStatus
Get the last health status
Sourcepub fn output_capture(&self) -> &OutputCapture
pub fn output_capture(&self) -> &OutputCapture
Get the output capture handle
Sourcepub fn subscribe_output(&self) -> Receiver<OutputEvent>
pub fn subscribe_output(&self) -> Receiver<OutputEvent>
Subscribe to live output events via broadcast channel.
Returns a receiver that gets a clone of every output event, suitable for streaming to WebSocket clients.
Sourcepub async fn shutdown(
&mut self,
grace_period: Duration,
) -> Result<bool, SpawnerError>
pub async fn shutdown( &mut self, grace_period: Duration, ) -> Result<bool, SpawnerError>
Graceful shutdown: SIGTERM, wait for grace_period, then SIGKILL if still alive.
Returns Ok(true) if the process exited gracefully, Ok(false) if it
required a SIGKILL, or Err on I/O failure.
Sourcepub async fn kill(self) -> Result<(), SpawnerError>
pub async fn kill(self) -> Result<(), SpawnerError>
Hard kill the agent process (immediate SIGKILL).
Sourcepub fn try_wait(&mut self) -> Result<Option<ExitStatus>, SpawnerError>
pub fn try_wait(&mut self) -> Result<Option<ExitStatus>, SpawnerError>
Check if the process has exited (non-blocking).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AgentHandle
impl !RefUnwindSafe for AgentHandle
impl Send for AgentHandle
impl Sync for AgentHandle
impl Unpin for AgentHandle
impl UnsafeUnpin for AgentHandle
impl !UnwindSafe for AgentHandle
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