Client-side utilities.
More...
|
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.
|
|
ClientFactoryConfig | Parse (const yaml_config::YamlConfig &value, formats::parse::To< ClientFactoryConfig >) |
|
Qos | Parse (const formats::json::Value &value, formats::parse::To< Qos >) |
|
void | ApplyQos (grpc::ClientContext &context, const Qos &qos, const testsuite::GrpcControl &testsuite_control) |
|
◆ ClientQos
◆ MiddlewareFactories
◆ Middlewares
A chain of middlewares.
Definition at line 17 of file fwd.hpp.
◆ 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_processor | task processor for blocking channel creation |
channel_credentials | channel credentials |
endpoint | string 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.