pub fn new<T: AdminConfig + ServerConfig + WorkerConfig + TlsConfig>(
        config: T,
        storage: Storage,
        max_buffer_size: usize,
        parser: Parser,
        mut log_drain: Box<dyn Drain>,
    ) -> Self {
        // initialize admin
        let ssl_context = common::ssl::ssl_context(config.tls()).unwrap_or_else(|e| {
            error!("failed to initialize TLS: {}", e);
            let _ = log_drain.flush();
            std::process::exit(1);
        });

        let mut admin = AdminBuilder::new(&config, ssl_context, log_drain).unwrap_or_else(|e| {
            error!("failed to initialize admin: {}", e);
            std::process::exit(1);
        });

        let workers = WorkersBuilder::new(&config, storage, parser).unwrap_or_else(|e| {
            error!("failed to initialize workers: {}", e);
            let _ = admin.log_flush();
            std::process::exit(1);
        });

        // initialize server
        let ssl_context = common::ssl::ssl_context(config.tls()).unwrap_or_else(|e| {
            error!("failed to initialize TLS: {}", e);
            let _ = admin.log_flush();
            std::process::exit(1);
        });
        let listener =
            ListenerBuilder::new(&config, ssl_context, max_buffer_size).unwrap_or_else(|e| {
                error!("failed to initialize listener: {}", e);
                let _ = admin.log_flush();
                std::process::exit(1);
            });

        Self {
            admin,
            listener,
            workers,
        }
    }
/// Creates a new `ProcessBuilder`
///
/// This function will terminate the program execution if there are any
/// issues encountered while initializing the components.
Creates a new `ProcessBuilder`
This function will terminate the program execution if there are any
issues encountered while initializing the components.
Creates a new ` ProcessBuilder ` This function will terminate the program execution if there are any issues encountered while initializing the components .
pub fn new<T: AdminConfig + ServerConfig + WorkerConfig + TlsConfig>(
        config: T,
        storage: Storage,
        max_buffer_size: usize,
        parser: Parser,
        mut log_drain: Box<dyn Drain>,
    ) -> Self {
        // initialize admin
        let ssl_context = common::ssl::ssl_context(config.tls()).unwrap_or_else(|e| {
            error!("failed to initialize TLS: {}", e);
            let _ = log_drain.flush();
            std::process::exit(1);
        });
        let mut admin = AdminBuilder::new(&config, ssl_context, log_drain).unwrap_or_else(|e| {
            error!("failed to initialize admin: {}", e);
            std::process::exit(1);
        });
        let workers = WorkersBuilder::new(&config, storage, parser).unwrap_or_else(|e| {
            error!("failed to initialize workers: {}", e);
            let _ = admin.log_flush();
            std::process::exit(1);
        });
        // initialize server
        let ssl_context = common::ssl::ssl_context(config.tls()).unwrap_or_else(|e| {
            error!("failed to initialize TLS: {}", e);
            let _ = admin.log_flush();
            std::process::exit(1);
        });
        let listener =
            ListenerBuilder::new(&config, ssl_context, max_buffer_size).unwrap_or_else(|e| {
                error!("failed to initialize listener: {}", e);
                let _ = admin.log_flush();
                std::process::exit(1);
            });
        Self {
            admin,
            listener,
            workers,
        }
    }
pub fn new < T : AdminConfig + ServerConfig + WorkerConfig + TlsConfig > ( config : T , storage : Storage , max_buffer_size : usize , parser : Parser , mut log_drain : Box < dyn Drain > , ) -> Self { // initialize admin let ssl_context = common :: ssl :: ssl_context ( config . tls ( ) ) . unwrap_or_else ( | e | { error ! ( " " e ) ; let _ = log_drain . flush ( ) ; std :: process :: exit ( 1 ) ; } ) ; let mut admin = AdminBuilder :: new ( & config , ssl_context , log_drain ) . unwrap_or_else ( | e | { error ! ( " " e ) ; std :: process :: exit ( 1 ) ; } ) ; let workers = WorkersBuilder :: new ( & config , storage , parser ) . unwrap_or_else ( | e | { error ! ( " " e ) ; let _ = admin . log_flush ( ) ; std :: process :: exit ( 1 ) ; } ) ; // initialize server let ssl_context = common :: ssl :: ssl_context ( config . tls ( ) ) . unwrap_or_else ( | e | { error ! ( " " e ) ; let _ = admin . log_flush ( ) ; std :: process :: exit ( 1 ) ; } ) ; let listener = ListenerBuilder :: new ( & config , ssl_context , max_buffer_size ) . unwrap_or_else ( | e | { error ! ( " " e ) ; let _ = admin . log_flush ( ) ; std :: process :: exit ( 1 ) ; } ) ; Self { admin , listener , workers , } }
Creates a new `ProcessBuilder`
This function will terminate the program execution if there are any
issues encountered while initializing the components.
Creates a new ` ProcessBuilder ` This function will terminate the program execution if there are any issues encountered while initializing the components .
config
T
storage
Storage
max_buffer_size
usize
parser
Parser
log_drain
Box<dyn Drain>
config
T
storage
Storage
max_buffer_size
usize
parser
Parser
log_drain
Box<dyn Drain>