feat: broadcast events that match active client subscriptions

A broadcast channel sends messages to all connections.  Any connection
with a subscription that matches then sends it via websocket.
This commit is contained in:
Greg Heartsfield
2021-12-05 20:28:02 -06:00
parent 8b4c43ae71
commit 23f47899cd
4 changed files with 70 additions and 8 deletions
+5
View File
@@ -52,6 +52,11 @@ impl From<EventCmd> for Result<Event> {
}
impl Event {
// get short event identifer
pub fn get_event_id_prefix(&self) -> String {
self.id.chars().take(8).collect()
}
// check if this event is valid (should be propagated, stored) based on signature.
fn is_valid(&self) -> bool {
// validation is performed by: