pub struct CloudSubscriber {
ctrl_tx: UnboundedSender<CtrlMsg>,
agents: Arc<Mutex<HashSet<String>>>,
}Fields§
§ctrl_tx: UnboundedSender<CtrlMsg>§agents: Arc<Mutex<HashSet<String>>>In-memory copy of subscribed agents, kept in sync with the WS loop so add_agent/remove_agent can be called before the WS connects.
Implementations§
Source§impl CloudSubscriber
impl CloudSubscriber
Sourcepub fn init_global(wstore: Arc<Store>)
pub fn init_global(wstore: Arc<Store>)
Initialize the global subscriber and start the background WS loop. Should be called once at startup. No-op if already initialized.
Sourcepub fn add_agent(&self, agent_id: &str)
pub fn add_agent(&self, agent_id: &str)
Notify the WS loop that a new agent is registered locally. Normalizes to lowercase and skips the WS send if already subscribed, so calling this on every COMMAND_AGENT_INPUT turn is safe.
Sourcepub fn remove_agent(&self, agent_id: &str)
pub fn remove_agent(&self, agent_id: &str)
Notify the WS loop that an agent has been unregistered.
Sourcepub fn reload_token(&self)
pub fn reload_token(&self)
Called after muxbus.login completes — trigger a fresh WS connection with the newly stored token.
Sourcepub fn subscribed_agents(&self) -> Vec<String>
pub fn subscribed_agents(&self) -> Vec<String>
Snapshot of the agents this sidecar has subscribed to the cloud relay (Tier-4), sorted for stable output. Empty when no MUXBUS_TOKEN is set (cloud disabled). Read-only; used by the discovery endpoint.
Auto Trait Implementations§
impl Freeze for CloudSubscriber
impl RefUnwindSafe for CloudSubscriber
impl Send for CloudSubscriber
impl Sync for CloudSubscriber
impl Unpin for CloudSubscriber
impl UnwindSafe for CloudSubscriber
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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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