/// Create a new `Worker` which will get new `Session`s from the MPSC queue
Create a new `Worker` which will get new `Session`s from the MPSC queue
Create a new ` Worker ` which will get new ` Session ` s from the MPSC queue
pub fn new(config: Arc<PingserverConfig>) -> 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")
        })?;
        let sessions = Slab::<Session>::new();
        let (session_sender, session_receiver) = sync_channel(128);
        let (message_sender, message_receiver) = sync_channel(128);
        Ok(Self {
            config,
            poll,
            message_receiver,
            message_sender,
            session_receiver,
            session_sender,
            sessions,
        })
    }
pub fn new ( config : Arc < PingserverConfig > ) -> Result < Self , std :: io :: Error > { let poll = Poll :: new ( ) . map_err ( | e | { error ! ( " " e ) ; std :: io :: Error :: new ( std :: io :: ErrorKind :: Other , " " ) } ) ? ; let sessions = Slab :: < Session > :: new ( ) ; let ( session_sender , session_receiver ) = sync_channel ( 128 ) ; let ( message_sender , message_receiver ) = sync_channel ( 128 ) ; Ok ( Self { config , poll , message_receiver , message_sender , session_receiver , session_sender , sessions , } ) }
Create a new `Worker` which will get new `Session`s from the MPSC queue
Create a new ` Worker ` which will get new ` Session ` s from the MPSC queue
config
Arc<PingserverConfig>