pub fn new<Io, F>(io: Io, codec: U, service: F) -> Self
    where
        IoBoxed: From<Io>,
        F: IntoService<S, DispatchItem<U>>,
    {
        let io = IoBoxed::from(io);
        let ka_timeout = Cell::new(Seconds(30).into());

        // register keepalive timer
        io.start_keepalive_timer(ka_timeout.get());

        Dispatcher {
            service: service.into_service(),
            fut: None,
            inner: DispatcherInner {
                pool: io.memory_pool().pool(),
                error: Cell::new(None),
                flags: Cell::new(Flags::empty()),
                st: Cell::new(DispatcherState::Processing),
                shared: Rc::new(DispatcherShared {
                    codec,
                    error: Cell::new(None),
                    inflight: Cell::new(0),
                }),
                io,
                ka_timeout,
            },
        }
    }
/// Construct new `Dispatcher` instance.
Construct new `Dispatcher` instance.
Construct new ` Dispatcher ` instance .
pub fn new<Io, F>(io: Io, codec: U, service: F) -> Self
    where
        IoBoxed: From<Io>,
        F: IntoService<S, DispatchItem<U>>,
    {
        let io = IoBoxed::from(io);
        let ka_timeout = Cell::new(Seconds(30).into());
        // register keepalive timer
        io.start_keepalive_timer(ka_timeout.get());
        Dispatcher {
            service: service.into_service(),
            fut: None,
            inner: DispatcherInner {
                pool: io.memory_pool().pool(),
                error: Cell::new(None),
                flags: Cell::new(Flags::empty()),
                st: Cell::new(DispatcherState::Processing),
                shared: Rc::new(DispatcherShared {
                    codec,
                    error: Cell::new(None),
                    inflight: Cell::new(0),
                }),
                io,
                ka_timeout,
            },
        }
    }
pub fn new < Io , F > ( io : Io , codec : U , service : F ) -> Self where IoBoxed : From < Io > , F : IntoService < S , DispatchItem < U > > , { let io = IoBoxed :: from ( io ) ; let ka_timeout = Cell :: new ( Seconds ( 30 ) . into ( ) ) ; // register keepalive timer io . start_keepalive_timer ( ka_timeout . get ( ) ) ; Dispatcher { service : service . into_service ( ) , fut : None , inner : DispatcherInner { pool : io . memory_pool ( ) . pool ( ) , error : Cell :: new ( None ) , flags : Cell :: new ( Flags :: empty ( ) ) , st : Cell :: new ( DispatcherState :: Processing ) , shared : Rc :: new ( DispatcherShared { codec , error : Cell :: new ( None ) , inflight : Cell :: new ( 0 ) , } ) , io , ka_timeout , } , } }
Construct new `Dispatcher` instance.
Construct new ` Dispatcher ` instance .
io
Io
codec
U
service
F
io
Io
codec
U
service
F