Skip to main content

Vine/Client/
PublishNotification.rs

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