async fn send(&self, event: ComponentEvent) -> Result<Option<oneshot::Receiver<()>>, Error> {
        if let Some(scope_moniker) = &self.scope_moniker {
            if !scope_moniker.contains_in_realm(&event.target_moniker) {
                return Ok(None);
            }
        }

        trace::duration!("component_manager", "events:send");
        let event_type = format!("{:?}", event.payload.type_());
        let target_moniker = event.target_moniker.to_string();
        trace::flow_begin!(
            "component_manager",
            "event",
            event.id,
            "event_type" => event_type.as_str(),
            "target_moniker" => target_moniker.as_str()
        );
        let (responder_tx, responder_rx) = oneshot::channel();
        {
            let mut tx = self.tx.lock().await;
            tx.send(Event { event, responder: responder_tx }).await?;
        }
        Ok(Some(responder_rx))
    }
/// Sends the event to an event stream, if fired in the scope of `scope_moniker`. Returns
/// a responder which can be blocked on.
Sends the event to an event stream, if fired in the scope of `scope_moniker`. Returns
a responder which can be blocked on.
Sends the event to an event stream if fired in the scope of ` scope_moniker ` . Returns a responder which can be blocked on .
async fn send(&self, event: ComponentEvent) -> Result<Option<oneshot::Receiver<()>>, Error> {
        if let Some(scope_moniker) = &self.scope_moniker {
            if !scope_moniker.contains_in_realm(&event.target_moniker) {
                return Ok(None);
            }
        }
        trace::duration!("component_manager", "events:send");
        let event_type = format!("{:?}", event.payload.type_());
        let target_moniker = event.target_moniker.to_string();
        trace::flow_begin!(
            "component_manager",
            "event",
            event.id,
            "event_type" => event_type.as_str(),
            "target_moniker" => target_moniker.as_str()
        );
        let (responder_tx, responder_rx) = oneshot::channel();
        {
            let mut tx = self.tx.lock().await;
            tx.send(Event { event, responder: responder_tx }).await?;
        }
        Ok(Some(responder_rx))
    }
async fn send ( & self , event : ComponentEvent ) -> Result < Option < oneshot :: Receiver < ( ) > > , Error > { if let Some ( scope_moniker ) = & self . scope_moniker { if ! scope_moniker . contains_in_realm ( & event . target_moniker ) { return Ok ( None ) ; } } trace :: duration ! ( " " " " ) ; let event_type = format ! ( " " event payload type_ ( ) ) ; let target_moniker = event . target_moniker . to_string ( ) ; trace :: flow_begin ! ( " " " " event id " " event_type as_str ( ) " " target_moniker as_str ( ) ) ; let ( responder_tx , responder_rx ) = oneshot :: channel ( ) ; { let mut tx = self . tx . lock ( ) . await ; tx . send ( Event { event , responder : responder_tx } ) . await ? ; } Ok ( Some ( responder_rx ) ) }
Sends the event to an event stream, if fired in the scope of `scope_moniker`.
Sends the event to an event stream if fired in the scope of ` scope_moniker ` .
&self
event
ComponentEvent
&self
event
ComponentEvent