userver: ugrpc::client Namespace Reference
Loading...
Searching...
No Matches
ugrpc::client Namespace Reference

Detailed Description

Client-side utilities.

Classes

class  AbortedError
 
class  AlreadyExistsError
 
class  BaseError
 Base exception for all the client errors. More...
 
class  BidirectionalStream
 Controls a request stream -> response stream RPC. More...
 
class  CallAnyBase
 Base class for any RPC. More...
 
class  CancelledError
 Concrete errors for all the error codes. More...
 
class  ClientFactory
 Creates generated gRPC clients. Has a minimal built-in channel cache: as long as a channel to the same endpoint is used somewhere, the same channel is given out. More...
 
class  ClientFactoryComponent
 Provides a ClientFactory in the component system. More...
 
struct  ClientFactorySettings
 Settings relating to the ClientFactory. More...
 
class  DataLossError
 
class  DeadlineExceededError
 
class  ErrorWithStatus
 Error with grpc::Status details. More...
 
class  FailedPreconditionError
 
class  InputStream
 Controls a single request -> response stream RPC. More...
 
class  InternalError
 
class  InvalidArgumentError
 
class  MiddlewareBase
 Base class for server gRPC middleware. More...
 
class  MiddlewareCallContext
 Context for middleware-specific data during gRPC call. More...
 
class  MiddlewareComponentBase
 Base class for client middleware component. More...
 
class  MiddlewareFactoryBase
 Factory that creates specific client middlewares for clients. More...
 
class  NotFoundError
 
class  OutOfRangeError
 
class  OutputStream
 Controls a request stream -> single response RPC. More...
 
class  PermissionDeniedError
 
struct  Qos
 
class  QueueHolder
 Manages a gRPC completion queue, usable only in clients. More...
 
class  ResourceExhaustedError
 
class  RpcCancelledError
 RPC failed due to task cancellation. More...
 
class  RpcError
 Error during an RPC. More...
 
class  RpcInterruptedError
 RPC failed without a status. This means that either the call got cancelled using TryCancel, the deadline has expired, or the channel is broken. More...
 
class  SimpleClientComponent
 Template class for a simple gRPC client. More...
 
class  StreamReadFuture
 StreamReadFuture for waiting a single read response from stream. More...
 
class  UnaryCall
 Controls a single request -> single response RPC. More...
 
class  UnaryFuture
 UnaryFuture for waiting a single response RPC. More...
 
class  UnauthenticatedError
 
class  UnavailableError
 
class  UnimplementedError
 
class  UnknownError
 

Typedefs

using MiddlewareFactories
 
using Middlewares = std::vector<std::shared_ptr<const MiddlewareBase>>
 A chain of middlewares.
 

Functions

std::shared_ptr< grpc::Channel > MakeChannel (engine::TaskProcessor &blocking_task_processor, std::shared_ptr< grpc::ChannelCredentials > channel_credentials, const std::string &endpoint)
 Create a new gRPC channel (connection pool) for the endpoint.
 
template<typename Client >
bool TryWaitForConnected (Client &client, engine::Deadline deadline, engine::TaskProcessor &blocking_task_processor)
 Wait until the channel state of client is READY. If the current state is already READY, returns true immediately. In case of multiple underlying channels, waits for all of them.
 
Qos Parse (const formats::json::Value &value, formats::parse::To< Qos >)
 
formats::json::Value Serialize (const Qos &qos, formats::serialize::To< formats::json::Value >)
 
void ApplyQos (grpc::ClientContext &context, const Qos &qos, const testsuite::GrpcControl &testsuite_control)
 

Typedef Documentation

◆ MiddlewareFactories

using ugrpc::client::MiddlewareFactories
Initial value:
std::vector<std::shared_ptr<const MiddlewareFactoryBase>>

Definition at line 82 of file base.hpp.

◆ Middlewares

using ugrpc::client::Middlewares = std::vector<std::shared_ptr<const MiddlewareBase>>

A chain of middlewares.

Definition at line 17 of file fwd.hpp.

Function Documentation

◆ MakeChannel()

std::shared_ptr< grpc::Channel > ugrpc::client::MakeChannel ( engine::TaskProcessor & blocking_task_processor,
std::shared_ptr< grpc::ChannelCredentials > channel_credentials,
const std::string & endpoint )

Create a new gRPC channel (connection pool) for the endpoint.

Channel creation is expensive, reuse channels if possible.

Each channel is fully thread-safe: it can be used across multiple threads, possibly from multiple clients and using multiple CompletionQueue instances at the same time.

Parameters
blocking_task_processortask processor for blocking channel creation
channel_credentialschannel credentials
endpointstring host:port
Returns
shared pointer to the gRPC channel

◆ TryWaitForConnected()

template<typename Client >
bool ugrpc::client::TryWaitForConnected ( Client & client,
engine::Deadline deadline,
engine::TaskProcessor & blocking_task_processor )

Wait until the channel state of client is READY. If the current state is already READY, returns true immediately. In case of multiple underlying channels, waits for all of them.

Returns
true if the state changed before deadline expired
Note
The wait operation does not support task cancellations

Definition at line 54 of file channels.hpp.