Mountain/Vine/Client/PublishNotification.rs
1
2//! Internal: publish a notification to the broadcast. Called from
3//! `SendNotification::Fn` after the wire send succeeds, and from the
4//! streaming multiplexer once it lands. `try_send` semantics - no
5//! awaiting, no failure surfaced (a slow subscriber must not stall
6//! the producer).
7
8use serde_json::Value;
9
10use crate::{
11 IPC::DevLog,
12 Vine::Client::{NotificationFrame, Shared},
13};
14
15pub fn Fn(SideCarIdentifier:&str, Method:&str, Parameters:&Value) {
16 let Frame = NotificationFrame::Struct {
17 SideCarIdentifier:SideCarIdentifier.to_string(),
18
19 Method:Method.to_string(),
20
21 Parameters:Parameters.clone(),
22
23 TimestampNanos:DevLog::NowNano::Fn(),
24 };
25
26 let _ = Shared::NOTIFICATION_BROADCAST.send(Frame);
27}