feat(client): introduce version-specific client modules (#2906)

This creates `client::conn::http1` and `client::conn::http2` modules,
both with specific `SendRequest`, `Connection`, and `Builder` types.
This commit is contained in:
Sean McArthur
2022-07-20 14:12:29 -07:00
committed by GitHub
parent 09e35668e5
commit 509672aada
4 changed files with 942 additions and 1 deletions

View File

@@ -1,7 +1,6 @@
#[cfg(feature = "http2")]
use std::future::Future;
use futures_util::FutureExt;
use tokio::sync::{mpsc, oneshot};
#[cfg(feature = "http2")]
@@ -169,6 +168,7 @@ impl<T, U> Receiver<T, U> {
#[cfg(feature = "http1")]
pub(crate) fn try_recv(&mut self) -> Option<(T, Callback<T, U>)> {
use futures_util::FutureExt;
match self.inner.recv().now_or_never() {
Some(Some(mut env)) => env.0.take(),
_ => None,