pub(in crate::http) fn new(
        config: Rc<DispatcherConfig<S, X, U>>,
        stream: T,
        peer_addr: Option<net::SocketAddr>,
        on_connect: Option<Box<dyn DataFactory>>,
    ) -> Self {
        let codec = Codec::new(config.timer.clone(), config.keep_alive_enabled());
        // slow request timer
        let timeout = config.client_timer();

        Dispatcher::with_timeout(
            config,
            stream,
            codec,
            BytesMut::with_capacity(READ_HW_BUFFER_SIZE),
            timeout,
            peer_addr,
            on_connect,
        )
    }
/// Create http/1 dispatcher.
Create http/1 dispatcher.
Create http / 1 dispatcher .
pub(in crate::http) fn new(
        config: Rc<DispatcherConfig<S, X, U>>,
        stream: T,
        peer_addr: Option<net::SocketAddr>,
        on_connect: Option<Box<dyn DataFactory>>,
    ) -> Self {
        let codec = Codec::new(config.timer.clone(), config.keep_alive_enabled());
        // slow request timer
        let timeout = config.client_timer();
        Dispatcher::with_timeout(
            config,
            stream,
            codec,
            BytesMut::with_capacity(READ_HW_BUFFER_SIZE),
            timeout,
            peer_addr,
            on_connect,
        )
    }
pub ( in crate :: http ) fn new ( config : Rc < DispatcherConfig < S , X , U > > , stream : T , peer_addr : Option < net :: SocketAddr > , on_connect : Option < Box < dyn DataFactory > > , ) -> Self { let codec = Codec :: new ( config . timer . clone ( ) , config . keep_alive_enabled ( ) ) ; // slow request timer let timeout = config . client_timer ( ) ; Dispatcher :: with_timeout ( config , stream , codec , BytesMut :: with_capacity ( READ_HW_BUFFER_SIZE ) , timeout , peer_addr , on_connect , ) }
Create http/1 dispatcher.
Create http / 1 dispatcher .
config
Rc<DispatcherConfig<S, X, U>>
stream
T
peer_addr
Option<net::SocketAddr>
on_connect
Option<Box<dyn DataFactory>>