pub struct PushDispatcher { /* private fields */ }Expand description
推送分发器
Implementations§
Source§impl PushDispatcher
impl PushDispatcher
Sourcepub fn new(
connections: Arc<DashMap<u64, ClientConn>>,
subscriptions: Arc<SubscriptionManager>,
) -> Self
pub fn new( connections: Arc<DashMap<u64, ClientConn>>, subscriptions: Arc<SubscriptionManager>, ) -> Self
创建推送分发器。connections 和 subscriptions 由
super::listener::ApiServer 共享;外部 sink / metrics 可通过
Self::with_metrics / Self::with_external_sink 后续注入。
Sourcepub fn with_metrics(self, metrics: Arc<GatewayMetrics>) -> Self
pub fn with_metrics(self, metrics: Arc<GatewayMetrics>) -> Self
设置监控指标引用
Sourcepub fn with_external_sink(self, sink: Arc<dyn ExternalPushSink>) -> Self
pub fn with_external_sink(self, sink: Arc<dyn ExternalPushSink>) -> Self
添加外部推送接收器(可多次调用注册多个)
Sourcepub async fn push_to_conn(&self, conn_id: u64, proto_id: u32, body: Vec<u8>)
pub async fn push_to_conn(&self, conn_id: u64, proto_id: u32, body: Vec<u8>)
向指定连接推送(自动处理 AES 加密)
Sourcepub async fn push_qot_to_conn(&self, conn_id: u64, proto_id: u32, body: Vec<u8>)
pub async fn push_qot_to_conn(&self, conn_id: u64, proto_id: u32, body: Vec<u8>)
向指定连接发送 quote 首推快照(带 qot:read 防御性过滤)。
Sourcepub async fn push_notify(&self, proto_id: u32, body: Vec<u8>)
pub async fn push_notify(&self, proto_id: u32, body: Vec<u8>)
向所有订阅了通知的连接广播(每个连接独立 AES 加密)
Sourcepub async fn push_broadcast(&self, proto_id: u32, body: Vec<u8>)
pub async fn push_broadcast(&self, proto_id: u32, body: Vec<u8>)
向所有已连接的客户端广播(到价提醒等,不需要订阅通知) C++ 检查 IsConnSubRecvNotify,对齐使用 InitConnect.recvNotify。
Sourcepub async fn push_qot(
&self,
security_key: &str,
sub_type: i32,
rehab_type: i32,
proto_id: u32,
body: Vec<u8>,
)
pub async fn push_qot( &self, security_key: &str, sub_type: i32, rehab_type: i32, proto_id: u32, body: Vec<u8>, )
向注册了 push 的连接推送 quote (F4 P1 BLOCKER fix).
v1.4.106 codex 1131 F4 [P1]: 改用 push_regs 三元 key 而非老的
subscriber map. 老路径让仅订未 RegPush 的 conn 收到 quote push, 违反
C++ QotSubscribe::GetPushConn 三元 key 路由 — F3 split state + F4
push 端真过滤组合修复.
v1.4.110 broker-aware closeout: security_key 是 push parser 传来的
cache-key display string ("market_code" or "market_code@b{id}").
Dispatch 通过 cache-key bridge 查询 broker-aware push_regs, 不再直接调用
legacy String facade.
rehab_type 仅 KL 类有意义 (sub_type 6/7/8/9/10/11/12/13/15/16/17), 其它 sub_type 应填 0. SubscriptionManager.get_qot_push_subscribers 内部对 非 KL 自动 normalize rehab=0.