pub struct AgentRegistry { /* private fields */ }Expand description
Agent Registry - single source of truth for agent management
Implementations§
Source§impl AgentRegistry
impl AgentRegistry
Sourcepub fn new(max_agents: usize, timeout_ms: u64) -> Self
pub fn new(max_agents: usize, timeout_ms: u64) -> Self
Create a new agent registry
§Arguments
max_agents- Maximum number of concurrent agents (default: 100)timeout_ms- Inactivity timeout in milliseconds (default: 60000)
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create registry with default settings (100 agents, 60s timeout)
Sourcepub fn heartbeat(&mut self, agent_id: &str) -> Result<(), String>
pub fn heartbeat(&mut self, agent_id: &str) -> Result<(), String>
Update heartbeat for an agent
Sourcepub fn get_stale_agents(&self) -> Vec<String>
pub fn get_stale_agents(&self) -> Vec<String>
Get agents with stale heartbeats (older than configured timeout)
Sourcepub fn prune_inactive_agents(&mut self) -> usize
pub fn prune_inactive_agents(&mut self) -> usize
Sourcepub fn has_sensory_agents(&self) -> bool
pub fn has_sensory_agents(&self) -> bool
Check if any agent has sensory capability (for stream gating)
Sourcepub fn has_motor_agents(&self) -> bool
pub fn has_motor_agents(&self) -> bool
Check if any agent has motor capability (for stream gating)
Sourcepub fn has_visualization_agents(&self) -> bool
pub fn has_visualization_agents(&self) -> bool
Check if any agent has visualization capability (for stream gating)
Sourcepub fn count_sensory_agents(&self) -> usize
pub fn count_sensory_agents(&self) -> usize
Get count of agents with sensory capability
Sourcepub fn count_motor_agents(&self) -> usize
pub fn count_motor_agents(&self) -> usize
Get count of agents with motor capability
Sourcepub fn count_visualization_agents(&self) -> usize
pub fn count_visualization_agents(&self) -> usize
Get count of agents with visualization capability
Sourcepub fn get_timeout_ms(&self) -> u64
pub fn get_timeout_ms(&self) -> u64
Get the configured timeout threshold in milliseconds
Auto Trait Implementations§
impl Freeze for AgentRegistry
impl RefUnwindSafe for AgentRegistry
impl Send for AgentRegistry
impl Sync for AgentRegistry
impl Unpin for AgentRegistry
impl UnsafeUnpin for AgentRegistry
impl UnwindSafe for AgentRegistry
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more