pub struct MonitorRegistry {
pub monitors: Mutex<HashMap<String, Vec<MonitorSub>>>,
pub conns: Mutex<HashMap<u64, Sender<Vec<u8>>>>,
}Expand description
Active connection channels and monitor subscriptions managed by the server.
Fields§
§monitors: Mutex<HashMap<String, Vec<MonitorSub>>>PV name → list of active monitor subscriptions.
conns: Mutex<HashMap<u64, Sender<Vec<u8>>>>Connection id → message sender.
Implementations§
Source§impl MonitorRegistry
impl MonitorRegistry
pub fn new() -> MonitorRegistry
Sourcepub async fn notify_monitors(&self, pv_name: &str, payload: &NtPayload)
pub async fn notify_monitors(&self, pv_name: &str, payload: &NtPayload)
Broadcast a monitor update for pv_name to all running subscribers.
Sourcepub async fn send_monitor_update_for(
&self,
pv_name: &str,
conn_id: u64,
ioid: u32,
payload: &NtPayload,
)
pub async fn send_monitor_update_for( &self, pv_name: &str, conn_id: u64, ioid: u32, payload: &NtPayload, )
Send a monitor update to a specific subscriber.
Sourcepub async fn update_monitor_subscription(
&self,
conn_id: u64,
ioid: u32,
pv_name: &str,
running: bool,
nfree: Option<u32>,
pipeline_enabled: Option<bool>,
) -> bool
pub async fn update_monitor_subscription( &self, conn_id: u64, ioid: u32, pv_name: &str, running: bool, nfree: Option<u32>, pipeline_enabled: Option<bool>, ) -> bool
Update a monitor subscription’s running/pipeline state.
Sourcepub async fn remove_monitor_subscription(
&self,
conn_id: u64,
ioid: u32,
pv_name: &str,
)
pub async fn remove_monitor_subscription( &self, conn_id: u64, ioid: u32, pv_name: &str, )
Remove a monitor subscription.
Sourcepub async fn cleanup_connection(&self, conn_id: u64)
pub async fn cleanup_connection(&self, conn_id: u64)
Remove all subscriptions and connection entries for a given connection.
Auto Trait Implementations§
impl !Freeze for MonitorRegistry
impl !RefUnwindSafe for MonitorRegistry
impl Send for MonitorRegistry
impl Sync for MonitorRegistry
impl Unpin for MonitorRegistry
impl UnsafeUnpin for MonitorRegistry
impl !UnwindSafe for MonitorRegistry
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