fn multi_worker<T: WorkerConfig>(
        config: &T,
        storage: Storage,
        parser: Parser,
    ) -> Result<WorkersBuilder<Storage, Parser, Request, Response>, Error> {
        let worker_config = config.worker();

        // initialize storage
        let storage = StorageWorkerBuilder::new(config, storage).unwrap_or_else(|e| {
            error!("{}", e);
            std::process::exit(1);
        });

        // initialize workers
        let mut workers = Vec::new();
        for _ in 0..worker_config.threads() {
            let worker = MultiWorkerBuilder::new(config, parser.clone()).unwrap_or_else(|e| {
                error!("{}", e);
                std::process::exit(1);
            });
            workers.push(worker);
        }

        Ok(WorkersBuilder::Multi { storage, workers })
    }
// Creates a multi-worker builder
Creates a multi-worker builder
Creates a multi - worker builder
fn multi_worker<T: WorkerConfig>(
        config: &T,
        storage: Storage,
        parser: Parser,
    ) -> Result<WorkersBuilder<Storage, Parser, Request, Response>, Error> {
        let worker_config = config.worker();
        // initialize storage
        let storage = StorageWorkerBuilder::new(config, storage).unwrap_or_else(|e| {
            error!("{}", e);
            std::process::exit(1);
        });
        // initialize workers
        let mut workers = Vec::new();
        for _ in 0..worker_config.threads() {
            let worker = MultiWorkerBuilder::new(config, parser.clone()).unwrap_or_else(|e| {
                error!("{}", e);
                std::process::exit(1);
            });
            workers.push(worker);
        }
        Ok(WorkersBuilder::Multi { storage, workers })
    }
fn multi_worker < T : WorkerConfig > ( config : & T , storage : Storage , parser : Parser , ) -> Result < WorkersBuilder < Storage , Parser , Request , Response > , Error > { let worker_config = config . worker ( ) ; // initialize storage let storage = StorageWorkerBuilder :: new ( config , storage ) . unwrap_or_else ( | e | { error ! ( " " e ) ; std :: process :: exit ( 1 ) ; } ) ; // initialize workers let mut workers = Vec :: new ( ) ; for _ in 0 .. worker_config . threads ( ) { let worker = MultiWorkerBuilder :: new ( config , parser . clone ( ) ) . unwrap_or_else ( | e | { error ! ( " " e ) ; std :: process :: exit ( 1 ) ; } ) ; workers . push ( worker ) ; } Ok ( WorkersBuilder :: Multi { storage , workers } ) }
Creates a multi-worker builder
Creates a multi - worker builder
config
&T
storage
Storage
parser
Parser
config
&T
storage
Storage
parser
Parser