Function spirit_tokio::utils::per_connection
source · pub fn per_connection<Config, F, R, O, C>(
action: F
) -> impl ResourceConsumer<Config, O, C>where
Config: ResourceConfig<O, C>,
Config::Resource: IntoIncoming,
F: Fn(&Arc<Spirit<O, C>>, &Arc<Config>, <Config::Resource as IntoIncoming>::Connection, &str) -> R + Sync + Send + 'static,
R: IntoFuture<Item = ()>,
R::Error: Display,
R::Future: Sync + Send + 'static,
O: Send + Sync + 'static,
C: Send + Sync + 'static,
Expand description
A simplified version of per_connection_init
.
This simpler version doesn’t have the initialization phase and doesn’t handle per-listener context. Usually it is enough and should be preferred.
The same note about terminating on errors and no limit on number of accepted connections
as with per_connection_init
applies.