Publish an event to the Bus (fire-and-forget from sync context)
(&self, def: &'static BusEventDef, properties: serde_json::Value)
| 775 | |
| 776 | /// Publish an event to the Bus (fire-and-forget from sync context) |
| 777 | fn publish_event(&self, def: &'static BusEventDef, properties: serde_json::Value) { |
| 778 | if let Some(ref bus) = self.bus { |
| 779 | if let Ok(handle) = tokio::runtime::Handle::try_current() { |
| 780 | let bus = bus.clone(); |
| 781 | handle.spawn(async move { |
| 782 | bus.publish(def, properties).await; |
| 783 | }); |
| 784 | } |
| 785 | } |
| 786 | } |
| 787 | |
| 788 | /// Publish a session info event (Created/Updated/Deleted) |
| 789 | fn publish_session_event(&self, def: &'static BusEventDef, session: &Session) { |
no test coverage detected