userver: ugrpc::client::CallOptions Class Reference
Loading...
Searching...
No Matches
ugrpc::client::CallOptions Class Reference

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

Detailed Description

Public Member Functions

void AddMetadata (std::string_view meta_key, std::string_view meta_value)
 Add the (meta_key, meta_value) pair to the metadata associated with a client call.
 
void SetAttempts (int attempts)
 
int GetAttempts () const
 
void SetTimeout (std::chrono::milliseconds timeout)
 
std::chrono::milliseconds GetTimeout () const
 
using ClientContextFactory = utils::move_only_function< std::unique_ptr< grpc::ClientContext >() const >
 
void SetClientContextFactory (ClientContextFactory &&client_context_factory)
 

Member Typedef Documentation

◆ ClientContextFactory

using ugrpc::client::CallOptions::ClientContextFactory = utils::move_only_function<std::unique_ptr<grpc::ClientContext>() const>

Set custom grpc::ClientContext factory.

'client_context_factory' may be called zero, once or more time, because of retries.

Definition at line 49 of file call_options.hpp.

Member Function Documentation

◆ SetAttempts()

void ugrpc::client::CallOptions::SetAttempts ( int  attempts)

Set and get retry attempts. Maximum number of retry attempts, including the original attempt.

◆ SetTimeout()

void ugrpc::client::CallOptions::SetTimeout ( std::chrono::milliseconds  timeout)

Set and get operation timeout.

In case of retries timeout applies to each attempt. Maximum time on call may actually be timeout * attempts + sum(backoff_i)

Examples
samples/grpc_service/src/greeter_client.cpp.

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