fn spawn_loop(mut self, mut rx: mpsc::Receiver<DispatchFn<Self>>) {
        tokio::spawn(async move {
            while let Some(dispatch) = rx.recv().await {
                tokio::task::block_in_place(|| {
                    dispatch(&mut self);
                });
            }
        });
    }
/// Spawn the message loop.
///
/// The default implementation spawns a Tokio task that processes messages from the receiver in
/// an infinite loop. Each message is wrapped in a `block_in_place` to allow handlers to do
/// synchronous work while holding a mutable reference to the agent.
Spawn the message loop.
The default implementation spawns a Tokio task that processes messages from the receiver in
an infinite loop. Each message is wrapped in a `block_in_place` to allow handlers to do
synchronous work while holding a mutable reference to the agent.
Spawn the message loop . The default implementation spawns a Tokio task that processes messages from the receiver in an infinite loop . Each message is wrapped in a ` block_in_place ` to allow handlers to do synchronous work while holding a mutable reference to the agent .
fn spawn_loop(mut self, mut rx: mpsc::Receiver<DispatchFn<Self>>) {
        tokio::spawn(async move {
            while let Some(dispatch) = rx.recv().await {
                tokio::task::block_in_place(|| {
                    dispatch(&mut self);
                });
            }
        });
    }
fn spawn_loop ( mut self , mut rx : mpsc :: Receiver < DispatchFn < Self > > ) { tokio :: spawn ( async move { while let Some ( dispatch ) = rx . recv ( ) . await { tokio :: task :: block_in_place ( | | { dispatch ( & mut self ) ; } ) ; } } ) ; }
Spawn the message loop.
Spawn the message loop .
mut self
rx
mpsc::Receiver<DispatchFn<Self>>
mut self
rx
mpsc::Receiver<DispatchFn<Self>>