pub fn run(&mut self) -> Result<()> {
        loop {
            match self.recv.recv().unwrap() {
                Event::Tx(tx, cb_chan) => {
                    // TODO: check for more txs & batch them.
                    // Ignoring the result because it's not important
                    // for correctness whether or not the client
                    // receives the response.
                    let _ = match self.process_tx(tx) {
                        Ok(new_entities) => cb_chan.send(TxReport::Success { new_entities }),
                        Err(e) => cb_chan.send(TxReport::Failure(format!("{:?}", e)))
                    };
                }
                Event::RebuiltIndex(new_db) => {
                    self.switch_to_rebuilt_indexes(new_db)?;
                },
                Event::Stop => break
            }
        }

        Ok(())
    }
/// Runs the transactor, listening on an MPSC channel for
/// transactions and other events.
Runs the transactor, listening on an MPSC channel for
transactions and other events.
Runs the transactor listening on an MPSC channel for transactions and other events .
pub fn run(&mut self) -> Result<()> {
        loop {
            match self.recv.recv().unwrap() {
                Event::Tx(tx, cb_chan) => {
                    // TODO: check for more txs & batch them.
                    // Ignoring the result because it's not important
                    // for correctness whether or not the client
                    // receives the response.
                    let _ = match self.process_tx(tx) {
                        Ok(new_entities) => cb_chan.send(TxReport::Success { new_entities }),
                        Err(e) => cb_chan.send(TxReport::Failure(format!("{:?}", e)))
                    };
                }
                Event::RebuiltIndex(new_db) => {
                    self.switch_to_rebuilt_indexes(new_db)?;
                },
                Event::Stop => break
            }
        }
        Ok(())
    }
pub fn run ( & mut self ) -> Result < ( ) > { loop { match self . recv . recv ( ) . unwrap ( ) { Event :: Tx ( tx , cb_chan ) => { // TODO: check for more txs & batch them. // Ignoring the result because it's not important // for correctness whether or not the client // receives the response. let _ = match self . process_tx ( tx ) { Ok ( new_entities ) => cb_chan . send ( TxReport :: Success { new_entities } ) , Err ( e ) => cb_chan . send ( TxReport :: Failure ( format ! ( " " e ) ) ) } ; } Event :: RebuiltIndex ( new_db ) => { self . switch_to_rebuilt_indexes ( new_db ) ? ; } , Event :: Stop => break } } Ok ( ( ) ) }
Runs the transactor, listening on an MPSC channel for
transactions and other events.
Runs the transactor listening on an MPSC channel for transactions and other events .
&mut self
&mut self