pub async fn call<T: Message>(&mut self, msg: T) -> Result<T::Result>
    where
        A: Handler<T>,
    {
        let (tx, rx) = oneshot::channel();
        self.tx
            .start_send(ActorEvent::Exec(Box::new(move |actor, ctx| {
                Box::pin(async move {
                    let mut actor = actor.lock().await;
                    let res = Handler::handle(&mut *actor, &ctx, msg).await;
                    let _ = tx.send(res);
                })
            })))?;

        Ok(rx.await?)
    }
/// Send a message `msg` to the actor and wait for the return value.
Send a message `msg` to the actor and wait for the return value.
Send a message ` msg ` to the actor and wait for the return value .
pub async fn call<T: Message>(&mut self, msg: T) -> Result<T::Result>
    where
        A: Handler<T>,
    {
        let (tx, rx) = oneshot::channel();
        self.tx
            .start_send(ActorEvent::Exec(Box::new(move |actor, ctx| {
                Box::pin(async move {
                    let mut actor = actor.lock().await;
                    let res = Handler::handle(&mut *actor, &ctx, msg).await;
                    let _ = tx.send(res);
                })
            })))?;
        Ok(rx.await?)
    }
pub async fn call < T : Message > ( & mut self , msg : T ) -> Result < T :: Result > where A : Handler < T > , { let ( tx , rx ) = oneshot :: channel ( ) ; self . tx . start_send ( ActorEvent :: Exec ( Box :: new ( move | actor , ctx | { Box :: pin ( async move { let mut actor = actor . lock ( ) . await ; let res = Handler :: handle ( & mut * actor , & ctx , msg ) . await ; let _ = tx . send ( res ) ; } ) } ) ) ) ? ; Ok ( rx . await ? ) }
Send a message `msg` to the actor and wait for the return value.
Send a message ` msg ` to the actor and wait for the return value .
&mut self
msg
T
&mut self
msg
T