pub fn new<T: WorkerConfig>(config: &T, parser: Parser) -> Result<Self, std::io::Error> {
        let poll = Poll::new().map_err(|e| {
            error!("{}", e);
            std::io::Error::new(std::io::ErrorKind::Other, "Failed to create epoll instance")
        })?;

        Ok(Self {
            poll,
            nevent: config.worker().nevent(),
            timeout: Duration::from_millis(config.worker().timeout() as u64),
            _request: PhantomData,
            _response: PhantomData,
            _storage: PhantomData,
            parser,
        })
    }
/// Create a new builder from the provided config and parser.
Create a new builder from the provided config and parser.
Create a new builder from the provided config and parser .
pub fn new<T: WorkerConfig>(config: &T, parser: Parser) -> Result<Self, std::io::Error> {
        let poll = Poll::new().map_err(|e| {
            error!("{}", e);
            std::io::Error::new(std::io::ErrorKind::Other, "Failed to create epoll instance")
        })?;
        Ok(Self {
            poll,
            nevent: config.worker().nevent(),
            timeout: Duration::from_millis(config.worker().timeout() as u64),
            _request: PhantomData,
            _response: PhantomData,
            _storage: PhantomData,
            parser,
        })
    }
pub fn new < T : WorkerConfig > ( config : & T , parser : Parser ) -> Result < Self , std :: io :: Error > { let poll = Poll :: new ( ) . map_err ( | e | { error ! ( " " e ) ; std :: io :: Error :: new ( std :: io :: ErrorKind :: Other , " " ) } ) ? ; Ok ( Self { poll , nevent : config . worker ( ) . nevent ( ) , timeout : Duration :: from_millis ( config . worker ( ) . timeout ( ) as u64 ) , _request : PhantomData , _response : PhantomData , _storage : PhantomData , parser , } ) }
Create a new builder from the provided config and parser.
Create a new builder from the provided config and parser .
config
&T
parser
Parser
config
&T
parser
Parser