#include <userver/ugrpc/client/generic.hpp>
Allows to talk to gRPC services (generic and normal) using dynamic method names.
Created using ClientFactory::MakeClient.
call_name
must be in the format full.path.to.TheService/MethodName
. Note that unlike in base grpc++, there must be no initial /
character.
The API is mainly intended for proxies, where the request-response body is passed unchanged, with settings taken solely from the RPC metadata. In cases where the code needs to operate on the actual messages, serialization of requests and responses is left as an excercise to the user.
Middlewares are customizable and are applied as usual, except that no message hooks are called, meaning that there won't be any logs of messages from the default middleware.
There are no per-call-name metrics by default, for details see GenericOptions::metrics_call_name.
For a more complete sample, see grpc_generic_api.
Definition at line 65 of file generic.hpp.
Public Member Functions | |
GenericClient (GenericClient &&) noexcept=default | |
GenericClient & | operator= (GenericClient &&) noexcept=delete |
client::UnaryCall< grpc::ByteBuffer > | UnaryCall (std::string_view call_name, const grpc::ByteBuffer &request, std::unique_ptr< grpc::ClientContext > context=std::make_unique< grpc::ClientContext >(), const GenericOptions &options={}) const |
Initiate a single request -> single response RPC with the given name. | |