pub fn start<F>(mut factory: F) -> TestServerRuntime
    where
        F: FnMut(ServerBuilder) -> ServerBuilder + Send + 'static,
    {
        let (tx, rx) = mpsc::channel();

        // run server in separate thread
        thread::spawn(move || {
            let sys = System::new("scrappy-test-server");
            factory(Server::build())
                .workers(1)
                .disable_signals()
                .start();

            tx.send(System::current()).unwrap();
            sys.run()
        });
        let system = rx.recv().unwrap();

        TestServerRuntime {
            system,
            addr: "127.0.0.1:0".parse().unwrap(),
            host: "127.0.0.1".to_string(),
            port: 0,
        }
    }
/// Start new server with server builder
Start new server with server builder
Start new server with server builder
pub fn start<F>(mut factory: F) -> TestServerRuntime
    where
        F: FnMut(ServerBuilder) -> ServerBuilder + Send + 'static,
    {
        let (tx, rx) = mpsc::channel();
        // run server in separate thread
        thread::spawn(move || {
            let sys = System::new("scrappy-test-server");
            factory(Server::build())
                .workers(1)
                .disable_signals()
                .start();
            tx.send(System::current()).unwrap();
            sys.run()
        });
        let system = rx.recv().unwrap();
        TestServerRuntime {
            system,
            addr: "127.0.0.1:0".parse().unwrap(),
            host: "127.0.0.1".to_string(),
            port: 0,
        }
    }
pub fn start < F > ( mut factory : F ) -> TestServerRuntime where F : FnMut ( ServerBuilder ) -> ServerBuilder + Send + ' static , { let ( tx , rx ) = mpsc :: channel ( ) ; // run server in separate thread thread :: spawn ( move | | { let sys = System :: new ( " " ) ; factory ( Server :: build ( ) ) . workers ( 1 ) . disable_signals ( ) . start ( ) ; tx . send ( System :: current ( ) ) . unwrap ( ) ; sys . run ( ) } ) ; let system = rx . recv ( ) . unwrap ( ) ; TestServerRuntime { system , addr : " " . parse ( ) . unwrap ( ) , host : " " . to_string ( ) , port : 0 , } }
Start new server with server builder
Start new server with server builder
factory
F