pub async fn subscribe(
        &self,
        scope_moniker: Option<AbsoluteMoniker>,
        event_types: Vec<EventType>,
    ) -> EventStream {
        let (tx, rx) = mpsc::channel(0);
        let dispatcher = EventDispatcher::new(scope_moniker, tx);
        let event_stream = EventStream::new(rx);

        let mut dispatcher_map = self.dispatcher_map.lock().await;
        for event_type in event_types {
            let dispatchers = dispatcher_map.entry(event_type).or_insert(vec![]);
            dispatchers.push(dispatcher.clone());
        }

        event_stream
    }
/// Subscribes to events of a provided set of EventTypes.
Subscribes to events of a provided set of EventTypes.
Subscribes to events of a provided set of EventTypes .
pub async fn subscribe(
        &self,
        scope_moniker: Option<AbsoluteMoniker>,
        event_types: Vec<EventType>,
    ) -> EventStream {
        let (tx, rx) = mpsc::channel(0);
        let dispatcher = EventDispatcher::new(scope_moniker, tx);
        let event_stream = EventStream::new(rx);
        let mut dispatcher_map = self.dispatcher_map.lock().await;
        for event_type in event_types {
            let dispatchers = dispatcher_map.entry(event_type).or_insert(vec![]);
            dispatchers.push(dispatcher.clone());
        }
        event_stream
    }
pub async fn subscribe ( & self , scope_moniker : Option < AbsoluteMoniker > , event_types : Vec < EventType > , ) -> EventStream { let ( tx , rx ) = mpsc :: channel ( 0 ) ; let dispatcher = EventDispatcher :: new ( scope_moniker , tx ) ; let event_stream = EventStream :: new ( rx ) ; let mut dispatcher_map = self . dispatcher_map . lock ( ) . await ; for event_type in event_types { let dispatchers = dispatcher_map . entry ( event_type ) . or_insert ( vec ! [ ] ) ; dispatchers . push ( dispatcher . clone ( ) ) ; } event_stream }
Subscribes to events of a provided set of EventTypes.
Subscribes to events of a provided set of EventTypes .
&self
scope_moniker
Option<AbsoluteMoniker>
event_types
Vec<EventType>
&self
scope_moniker
Option<AbsoluteMoniker>
event_types
Vec<EventType>