Update rest-grpc-multiplex example to include reflection (#1902)

This commit is contained in:
David Pedersen
2023-04-01 20:49:36 +02:00
committed by GitHub
parent 0096fa6e1e
commit 24f8dc53f4
4 changed files with 26 additions and 8 deletions
@@ -46,12 +46,12 @@ where
A: Service<Request<Body>, Error = Infallible>,
A::Response: IntoResponse,
A::Future: Send + 'static,
B: Service<Request<Body>, Error = Infallible>,
B: Service<Request<Body>>,
B::Response: IntoResponse,
B::Future: Send + 'static,
{
type Response = Response<BoxBody>;
type Error = Infallible;
type Error = B::Error;
type Future = BoxFuture<'static, Result<Self::Response, Self::Error>>;
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
@@ -62,7 +62,7 @@ where
return Ok(()).into();
}
(false, _) => {
ready!(self.rest.poll_ready(cx))?;
ready!(self.rest.poll_ready(cx)).map_err(|err| match err {})?;
self.rest_ready = true;
}
(_, false) => {
@@ -98,7 +98,7 @@ where
self.rest_ready = false;
let future = self.rest.call(req);
Box::pin(async move {
let res = future.await?;
let res = future.await.map_err(|err| match err {})?;
Ok(res.into_response())
})
}