userver: ugrpc::client::SimpleClientComponent< Client > Class Template Reference
Loading...
Searching...
No Matches
ugrpc::client::SimpleClientComponent< Client > Class Template Referencefinal

#include <userver/ugrpc/client/simple_client_component.hpp>

Detailed Description

template<typename Client>
class ugrpc::client::SimpleClientComponent< Client >

Template class for a simple gRPC client.

The component is used as a storage of a gRPC client if you're OK with generated client and don't need to wrap it. The client can be fetched using GetClient method.

Example usage:

int main(...)
{
...
...
}
MyComponent::MyComponent(const components::ComponentConfig& config,
{
MyClient& client = component.GetClient();
... use client ...
}

Definition at line 58 of file simple_client_component.hpp.

+ Inheritance diagram for ugrpc::client::SimpleClientComponent< Client >:
+ Collaboration diagram for ugrpc::client::SimpleClientComponent< Client >:

Public Member Functions

 SimpleClientComponent (const components::ComponentConfig &config, const components::ComponentContext &context)
 
Client & GetClient ()
 @brief Get gRPC service client
 

Constructor & Destructor Documentation

◆ SimpleClientComponent()

template<typename Client >
ugrpc::client::SimpleClientComponent< Client >::SimpleClientComponent ( const components::ComponentConfig & config,
const components::ComponentContext & context )
inline

Definition at line 60 of file simple_client_component.hpp.

Member Function Documentation

◆ GetClient()

template<typename Client >
Client & ugrpc::client::SimpleClientComponent< Client >::GetClient ( )
inline

@brief Get gRPC service client

Definition at line 72 of file simple_client_component.hpp.


The documentation for this class was generated from the following file: