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