Struct ntex_io::Dispatcher
source · pub struct Dispatcher<S, U>where
S: Service<DispatchItem<U>, Response = Option<<U as Encoder>::Item>>,
S: 'static,
U: Encoder,
U: Decoder,{ /* private fields */ }
Expand description
Dispatcher - is a future that reads frames from bytes stream and pass then to the service.
Implementations§
source§impl<S, U> Dispatcher<S, U>where
S: Service<DispatchItem<U>, Response = Option<<U as Encoder>::Item>> + 'static,
U: Decoder + Encoder + 'static,
impl<S, U> Dispatcher<S, U>where
S: Service<DispatchItem<U>, Response = Option<<U as Encoder>::Item>> + 'static,
U: Decoder + Encoder + 'static,
sourcepub fn new<Io, F>(io: Io, codec: U, service: F) -> Selfwhere
IoBoxed: From<Io>,
F: IntoService<S, DispatchItem<U>>,
pub fn new<Io, F>(io: Io, codec: U, service: F) -> Selfwhere
IoBoxed: From<Io>,
F: IntoService<S, DispatchItem<U>>,
Construct new Dispatcher
instance.
sourcepub fn keepalive_timeout(self, timeout: Seconds) -> Self
pub fn keepalive_timeout(self, timeout: Seconds) -> Self
Set keep-alive timeout.
To disable timeout set value to 0.
By default keep-alive timeout is set to 30 seconds.
sourcepub fn disconnect_timeout(self, val: Seconds) -> Self
pub fn disconnect_timeout(self, val: Seconds) -> Self
Set connection disconnect timeout in seconds.
Defines a timeout for disconnect connection. If a disconnect procedure does not complete within this time, the connection get dropped.
To disable timeout set value to 0.
By default disconnect timeout is set to 1 seconds.
Trait Implementations§
source§impl<S, U> Future for Dispatcher<S, U>where
S: Service<DispatchItem<U>, Response = Option<<U as Encoder>::Item>> + 'static,
U: Decoder + Encoder + 'static,
impl<S, U> Future for Dispatcher<S, U>where
S: Service<DispatchItem<U>, Response = Option<<U as Encoder>::Item>> + 'static,
U: Decoder + Encoder + 'static,
impl<'__pin, S, U> Unpin for Dispatcher<S, U>where
__Origin<'__pin, S, U>: Unpin,
S: Service<DispatchItem<U>, Response = Option<<U as Encoder>::Item>>,
S: 'static,
U: Encoder,
U: Decoder,
Auto Trait Implementations§
impl<S, U> !RefUnwindSafe for Dispatcher<S, U>
impl<S, U> !Send for Dispatcher<S, U>
impl<S, U> !Sync for Dispatcher<S, U>
impl<S, U> !UnwindSafe for Dispatcher<S, U>
Blanket Implementations§
source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more