// Invoked by the runtime host to give this provider plugin the ability to communicate
// with actors
Invoked by the runtime host to give this provider plugin the ability to communicate
with actors
Invoked by the runtime host to give this provider plugin the ability to communicate with actors
fn configure_dispatch(&self, dispatcher: Box<dyn Dispatcher>) -> Result<(), Box<dyn Error>> {
        trace!("Dispatcher received.");
        let mut lock = self.dispatcher.write().unwrap();
        *lock = dispatcher;
        let td = self.turn_delay_millis;
        spawn_health_check(self.nc.clone(), self.dispatcher.clone(), self.store.clone());
        let (nc, dp, sto) = (self.nc.clone(), self.dispatcher.clone(), self.store.clone());
        let _h = self
            .nc
            .queue_subscribe(&protocol::commands::arena_control_subject(), PROVIDER_QUEUE)?
            .with_handler(move |msg| {
                let ac: ArenaControlCommand = serde_json::from_slice(&msg.data).unwrap();
                handle_control_command(ac, nc.clone(), dp.clone(), sto.clone(), msg.reply, td);
                Ok(())
            });
        Ok(())
    }
fn configure_dispatch ( & self , dispatcher : Box < dyn Dispatcher > ) -> Result < ( ) , Box < dyn Error > > { trace ! ( " " ) ; let mut lock = self . dispatcher . write ( ) . unwrap ( ) ; * lock = dispatcher ; let td = self . turn_delay_millis ; spawn_health_check ( self . nc . clone ( ) , self . dispatcher . clone ( ) , self . store . clone ( ) ) ; let ( nc , dp , sto ) = ( self . nc . clone ( ) , self . dispatcher . clone ( ) , self . store . clone ( ) ) ; let _h = self . nc . queue_subscribe ( & protocol :: commands :: arena_control_subject ( ) , PROVIDER_QUEUE ) ? . with_handler ( move | msg | { let ac : ArenaControlCommand = serde_json :: from_slice ( & msg . data ) . unwrap ( ) ; handle_control_command ( ac , nc . clone ( ) , dp . clone ( ) , sto . clone ( ) , msg . reply , td ) ; Ok ( ( ) ) } ) ; Ok ( ( ) ) }
Invoked by the runtime host to give this provider plugin the ability to communicate
with actors
Invoked by the runtime host to give this provider plugin the ability to communicate with actors
&self
dispatcher
Box<dyn Dispatcher>