pub fn run(mut self) -> Server {
        if self.sockets.is_empty() {
            panic!("Server should have at least one bound socket");
        } else {
            info!("Starting {} workers", self.threads);

            // start workers
            let workers = (0..self.threads)
                .map(|idx| {
                    let worker = self.start_worker(idx, self.accept.get_notify());
                    self.workers.push((idx, worker.clone()));

                    worker
                })
                .collect();

            // start accept thread
            for sock in &self.sockets {
                info!("Starting \"{}\" service on {}", sock.1, sock.2);
            }
            self.accept.start(
                mem::take(&mut self.sockets)
                    .into_iter()
                    .map(|t| (t.0, t.2))
                    .collect(),
                workers,
            );

            // handle signals
            if !self.no_signals {
                Signals::start(self.server.clone()).unwrap();
            }

            // start http server actor
            let server = self.server.clone();
            spawn(self);
            server
        }
    }
/// Starts processing incoming connections and return server controller.
Starts processing incoming connections and return server controller.
Starts processing incoming connections and return server controller .
pub fn run(mut self) -> Server {
        if self.sockets.is_empty() {
            panic!("Server should have at least one bound socket");
        } else {
            info!("Starting {} workers", self.threads);
            // start workers
            let workers = (0..self.threads)
                .map(|idx| {
                    let worker = self.start_worker(idx, self.accept.get_notify());
                    self.workers.push((idx, worker.clone()));
                    worker
                })
                .collect();
            // start accept thread
            for sock in &self.sockets {
                info!("Starting \"{}\" service on {}", sock.1, sock.2);
            }
            self.accept.start(
                mem::take(&mut self.sockets)
                    .into_iter()
                    .map(|t| (t.0, t.2))
                    .collect(),
                workers,
            );
            // handle signals
            if !self.no_signals {
                Signals::start(self.server.clone()).unwrap();
            }
            // start http server actor
            let server = self.server.clone();
            spawn(self);
            server
        }
    }
pub fn run ( mut self ) -> Server { if self . sockets . is_empty ( ) { panic ! ( " " ) ; } else { info ! ( " " self threads ) ; // start workers let workers = ( 0 .. self . threads ) . map ( | idx | { let worker = self . start_worker ( idx , self . accept . get_notify ( ) ) ; self . workers . push ( ( idx , worker . clone ( ) ) ) ; worker } ) . collect ( ) ; // start accept thread for sock in & self . sockets { info ! ( " \" \" " sock 1 sock 2 ) ; } self . accept . start ( mem :: take ( & mut self . sockets ) . into_iter ( ) . map ( | t | ( t . 0 , t . 2 ) ) . collect ( ) , workers , ) ; // handle signals if ! self . no_signals { Signals :: start ( self . server . clone ( ) ) . unwrap ( ) ; } // start http server actor let server = self . server . clone ( ) ; spawn ( self ) ; server } }
Starts processing incoming connections and return server controller.
Starts processing incoming connections and return server controller .
mut self
mut self