pub struct AgentProcessRegistry {
inner: Mutex<HashMap<String, RegistryEntry>>,
broker: Option<Arc<Broker>>,
}Fields§
§inner: Mutex<HashMap<String, RegistryEntry>>§broker: Option<Arc<Broker>>Implementations§
Source§impl AgentProcessRegistry
impl AgentProcessRegistry
pub fn new(broker: Option<Arc<Broker>>) -> Self
Sourcepub fn ensure_tracker(&self, block_id: &str) -> Arc<dyn TrackerHandle>
pub fn ensure_tracker(&self, block_id: &str) -> Arc<dyn TrackerHandle>
Ensure a tracker exists for this block. Idempotent — calling twice for the same block returns the existing tracker so the job survives controller re-creation (e.g. on /clear).
Sourcepub fn remove(&self, block_id: &str)
pub fn remove(&self, block_id: &str)
Drop a block’s tracker — call when the pane closes. The tracker’s
Drop impl kills the whole process tree (via KILL_ON_JOB_CLOSE
on Windows, cgroup.kill on Linux, killpg on macOS).
Sourcepub fn list_block(&self, block_id: &str) -> Vec<TrackedProcess>
pub fn list_block(&self, block_id: &str) -> Vec<TrackedProcess>
Current members of a block’s tracker, for the RPC endpoint.
Sourcepub fn confidence_of(&self, block_id: &str) -> TrackingConfidence
pub fn confidence_of(&self, block_id: &str) -> TrackingConfidence
Confidence of a block’s tracker — drives the “tracking is best-effort on macOS” badge in the swarm UI.
Sourcepub fn list_all_blocks(&self) -> Vec<String>
pub fn list_all_blocks(&self) -> Vec<String>
All tracked blocks — used by the swarm panel’s aggregate view.
Sourcepub fn kill_tree(&self, block_id: &str) -> bool
pub fn kill_tree(&self, block_id: &str) -> bool
Kill the entire process tree for a given block. Returns true
if a tracker was found (the kill was dispatched). Does NOT
synchronously wait for descendants to actually exit — the
poller’s next tick will pick up the state changes and emit
agent:process-exited events the frontend can react to.
Sourcepub fn kill_pid(&self, block_id: &str, pid: u32) -> bool
pub fn kill_pid(&self, block_id: &str, pid: u32) -> bool
Kill a single PID if it’s a member of the given block’s tree.
Returns true if the tracker was found and the PID matched.
Sourcepub fn poll_and_emit(&self)
pub fn poll_and_emit(&self)
Poll every tracked block’s membership and diff against the
last-known set. Emits agent:process-added / -exited events
for each delta.
Called by a background Tokio task on a ~2s interval.
fn emit(&self, event_name: &str, block_id: &str, data: Value)
Auto Trait Implementations§
impl !Freeze for AgentProcessRegistry
impl !RefUnwindSafe for AgentProcessRegistry
impl Send for AgentProcessRegistry
impl Sync for AgentProcessRegistry
impl Unpin for AgentProcessRegistry
impl !UnwindSafe for AgentProcessRegistry
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.