/// Launches only consensus messages handler.
/// This may be used if you want to customize api with the `ApiContext`.
Launches only consensus messages handler.
This may be used if you want to customize api with the `ApiContext`.
Launches only consensus messages handler . This may be used if you want to customize api with the ` ApiContext ` .
fn run_handler(mut self, handshake_params: &HandshakeParams) -> Result<(), Error> {
        self.handler.initialize();
        let pool_size = self.thread_pool_size;
        let (handler_part, network_part, internal_part) = self.into_reactor();
        let handshake_params = handshake_params.clone();
        let network_thread = thread::spawn(move || {
            let mut core = Core::new().map_err(into_failure)?;
            let handle = core.handle();
            let mut pool_builder = ThreadPoolBuilder::new();
            if let Some(pool_size) = pool_size {
                pool_builder.pool_size(pool_size as usize);
            }
            let thread_pool = pool_builder.build();
            let executor = thread_pool.sender().clone();
            core.handle().spawn(internal_part.run(handle, executor));
            let network_handler = network_part.run(&core.handle(), &handshake_params);
            core.run(network_handler)
                .map(drop)
                .map_err(|e| format_err!("An error in the `Network` thread occurred: {}", e))
        });
        let mut core = Core::new().map_err(into_failure)?;
        core.run(handler_part.run())
            .map_err(|_| format_err!("An error in the `Handler` thread occurred"))?;
        network_thread.join().unwrap()
    }
fn run_handler ( mut self , handshake_params : & HandshakeParams ) -> Result < ( ) , Error > { self . handler . initialize ( ) ; let pool_size = self . thread_pool_size ; let ( handler_part , network_part , internal_part ) = self . into_reactor ( ) ; let handshake_params = handshake_params . clone ( ) ; let network_thread = thread :: spawn ( move | | { let mut core = Core :: new ( ) . map_err ( into_failure ) ? ; let handle = core . handle ( ) ; let mut pool_builder = ThreadPoolBuilder :: new ( ) ; if let Some ( pool_size ) = pool_size { pool_builder . pool_size ( pool_size as usize ) ; } let thread_pool = pool_builder . build ( ) ; let executor = thread_pool . sender ( ) . clone ( ) ; core . handle ( ) . spawn ( internal_part . run ( handle , executor ) ) ; let network_handler = network_part . run ( & core . handle ( ) , & handshake_params ) ; core . run ( network_handler ) . map ( drop ) . map_err ( | e | format_err ! ( " " e ) ) } ) ; let mut core = Core :: new ( ) . map_err ( into_failure ) ? ; core . run ( handler_part . run ( ) ) . map_err ( | _ | format_err ! ( " " ) ) ? ; network_thread . join ( ) . unwrap ( ) }
Launches only consensus messages handler.
Launches only consensus messages handler .
mut self
handshake_params
&HandshakeParams