You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.
The underlying http::Request type from which the tower_grpc::Request type is made from has a useful method called extensions_mut(), which can store arbitrary data alongside the request, as long as it is Send + Sync + 'static. The data can then be queried later with:
ifletSome(extra_metadata) = request.extensions().get::<MyMetadata>(){// Respond to request one way.}else{// Respond to request another way.}
It would be nice to preserve this metadata in the tower_grpc::Request and make it accessible through an extensions() method.
The text was updated successfully, but these errors were encountered:
I explained some concerns I have about exposing HTTP and language interoperability in #95, but I still like the idea of having a getter that returns an Option like this, especially if the API would be easy to use with protobuf types. I think an API that looks almost the same as this could be built on top of gRPC custom metadata primitives (which are being worked on now in #92 and #90).
Sounds good. I've decided to close the associated PR #95 as well as this issue in favor of waiting for your upcoming PR with MetadataMap support to land. Thanks for working on this.
The underlying
http::Request
type from which thetower_grpc::Request
type is made from has a useful method calledextensions_mut()
, which can store arbitrary data alongside the request, as long as it isSend + Sync + 'static
. The data can then be queried later with:It would be nice to preserve this metadata in the
tower_grpc::Request
and make it accessible through anextensions()
method.The text was updated successfully, but these errors were encountered: