Classes and functions for performing hedged requests.
Use MakeHedgedRedisRequest method to perform hedged redis request.
Example(Sync): auto result = ::redis::MakeHedgedRedisRequest<storages::redis::RequestHGet>( redis_client_shared_ptr, &storages::redis::Client::Hget, redis_cc, hedging_settings, key, field); Example(Async): auto future = ::redis::MakeHedgedRedisRequestAsync<storages::redis::RequestHGet>( redis_client_shared_ptr, &storages::redis::Client::Hget, redis_cc, hedging_settings, key, field); auto result = future.Get();
Definition in file hedged_request.hpp.
Go to the source code of this file.
#include <optional>
#include <userver/storages/redis/client.hpp>
#include <userver/storages/redis/command_control.hpp>
#include <userver/utils/hedged_request.hpp>
Typedefs | |
template<typename RedisRequestType > | |
using | redis::HedgedRedisRequest = utils::hedging::HedgedRequestFuture<impl::RedisRequestStrategy<RedisRequestType>> |
Functions | |
template<typename RedisRequestType , typename... Args, typename M = RedisRequestType (storages::redis::Client::*)(Args..., const redis::CommandControl&)> | |
HedgedRedisRequest< RedisRequestType > | redis::MakeHedgedRedisRequestAsync (std::shared_ptr< storages::redis::Client > redis, M method, const redis::CommandControl &cc, utils::hedging::HedgingSettings hedging_settings, Args... args) |
template<typename RedisRequestType , typename... Args, typename M = RedisRequestType (storages::redis::Client::*)(Args..., const redis::CommandControl&)> | |
std::optional< typename RedisRequestType::Reply > | redis::MakeHedgedRedisRequest (std::shared_ptr< storages::redis::Client > redis, M method, const redis::CommandControl &cc, utils::hedging::HedgingSettings hedging_settings, Args... args) |
template<typename RedisRequestType , typename... Args, typename M = RedisRequestType (storages::redis::Client::*)(Args..., const redis::CommandControl&)> | |
std::vector< std::optional< typename RedisRequestType::Reply > > | redis::MakeBulkHedgedRedisRequest (std::shared_ptr< storages::redis::Client > redis, M method, const redis::CommandControl &cc, utils::hedging::HedgingSettings hedging_settings, std::vector< std::tuple< Args... > > args) |
template<typename RedisRequestType , typename... Args, typename M = RedisRequestType (storages::redis::Client::*)(Args..., const redis::CommandControl&)> | |
utils::hedging::HedgedRequestBulkFuture< redis::impl::RedisRequestStrategy< RedisRequestType > > | redis::MakeBulkHedgedRedisRequestAsync (std::shared_ptr< storages::redis::Client > redis, M method, const redis::CommandControl &cc, utils::hedging::HedgingSettings hedging_settings, std::vector< std::tuple< Args... > > args) |
using redis::HedgedRedisRequest = utils::hedging::HedgedRequestFuture<impl::RedisRequestStrategy<RedisRequestType>> |
Definition at line 67 of file hedged_request.hpp.
std::vector< std::optional< typename RedisRequestType::Reply > > redis::MakeBulkHedgedRedisRequest | ( | std::shared_ptr< storages::redis::Client > | redis, |
M | method, | ||
const redis::CommandControl & | cc, | ||
utils::hedging::HedgingSettings | hedging_settings, | ||
std::vector< std::tuple< Args... > > | args ) |
Same as MakeHedgedRedisRequest but accepting a vector of argument tuples instead of a single set of arguments. And return vector of replies corresponding to input args.
< We do retries ourselves
Definition at line 129 of file hedged_request.hpp.
utils::hedging::HedgedRequestBulkFuture< redis::impl::RedisRequestStrategy< RedisRequestType > > redis::MakeBulkHedgedRedisRequestAsync | ( | std::shared_ptr< storages::redis::Client > | redis, |
M | method, | ||
const redis::CommandControl & | cc, | ||
utils::hedging::HedgingSettings | hedging_settings, | ||
std::vector< std::tuple< Args... > > | args ) |
Same as MakeHedgedRedisRequestAsync but accepting a vector of argument tuples instead of a single set of arguments. And return vector of replies corresponding to input args.
< We do retries ourselves
Definition at line 163 of file hedged_request.hpp.
std::optional< typename RedisRequestType::Reply > redis::MakeHedgedRedisRequest | ( | std::shared_ptr< storages::redis::Client > | redis, |
M | method, | ||
const redis::CommandControl & | cc, | ||
utils::hedging::HedgingSettings | hedging_settings, | ||
Args... | args ) |
< We do retries ourselves
Definition at line 101 of file hedged_request.hpp.
HedgedRedisRequest< RedisRequestType > redis::MakeHedgedRedisRequestAsync | ( | std::shared_ptr< storages::redis::Client > | redis, |
M | method, | ||
const redis::CommandControl & | cc, | ||
utils::hedging::HedgingSettings | hedging_settings, | ||
Args... | args ) |
< We do retries ourselves
Definition at line 73 of file hedged_request.hpp.