pub(in crate::http) fn new(io: Io<F>, config: Rc<DispatcherConfig<S, X, U>>) -> Self {
        let codec = Codec::new(config.timer.clone(), config.keep_alive_enabled());
        io.set_disconnect_timeout(config.client_disconnect.into());

        // slow-request timer
        let flags = if config.client_timeout.is_zero() {
            Flags::empty()
        } else {
            io.start_keepalive_timer(config.client_timeout);
            Flags::KEEPALIVE_REG
        };

        Dispatcher {
            call: CallState::None,
            st: State::ReadFirstRequest,
            inner: DispatcherInner {
                io,
                flags,
                codec,
                config,
                error: None,
                payload: None,
                _t: marker::PhantomData,
            },
        }
    }
/// Construct new `Dispatcher` instance with outgoing messages stream.
Construct new `Dispatcher` instance with outgoing messages stream.
Construct new ` Dispatcher ` instance with outgoing messages stream .
pub(in crate::http) fn new(io: Io<F>, config: Rc<DispatcherConfig<S, X, U>>) -> Self {
        let codec = Codec::new(config.timer.clone(), config.keep_alive_enabled());
        io.set_disconnect_timeout(config.client_disconnect.into());
        // slow-request timer
        let flags = if config.client_timeout.is_zero() {
            Flags::empty()
        } else {
            io.start_keepalive_timer(config.client_timeout);
            Flags::KEEPALIVE_REG
        };
        Dispatcher {
            call: CallState::None,
            st: State::ReadFirstRequest,
            inner: DispatcherInner {
                io,
                flags,
                codec,
                config,
                error: None,
                payload: None,
                _t: marker::PhantomData,
            },
        }
    }
pub ( in crate :: http ) fn new ( io : Io < F > , config : Rc < DispatcherConfig < S , X , U > > ) -> Self { let codec = Codec :: new ( config . timer . clone ( ) , config . keep_alive_enabled ( ) ) ; io . set_disconnect_timeout ( config . client_disconnect . into ( ) ) ; // slow-request timer let flags = if config . client_timeout . is_zero ( ) { Flags :: empty ( ) } else { io . start_keepalive_timer ( config . client_timeout ) ; Flags :: KEEPALIVE_REG } ; Dispatcher { call : CallState :: None , st : State :: ReadFirstRequest , inner : DispatcherInner { io , flags , codec , config , error : None , payload : None , _t : marker :: PhantomData , } , } }
Construct new `Dispatcher` instance with outgoing messages stream.
Construct new ` Dispatcher ` instance with outgoing messages stream .
io
Io<F>
config
Rc<DispatcherConfig<S, X, U>>
io
Io<F>
config
Rc<DispatcherConfig<S, X, U>>