userver
C++ Async Framework
Toggle main menu visibility
Documentation
API Groups
Namespaces
Reference
Class List
Class Index
File List
Macros
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
wait_connected_mode.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file
4
/// @brief @copybrief storages::redis::RedisWaitConnected
5
6
#
include
<
chrono
>
7
#
include
<
string
>
8
9
#
include
<
userver
/
formats
/
parse
/
to
.
hpp
>
10
#
include
<
userver
/
testsuite
/
redis_control
.
hpp
>
11
12
USERVER_NAMESPACE_BEGIN
13
14
namespace
storages::
redis
{
15
16
/// Default timeout for Redis connection wait
17
inline
constexpr
auto
kRedisWaitConnectedDefaultTimeout
= std::chrono::seconds(11);
18
19
/// Connection wait mode for the Redis
20
enum
class
WaitConnectedMode
{
21
kNoWait
,
///< Do not wait.
22
kMaster
,
///< If we need to write to redis.
23
kMasterOrSlave
,
///< Enough for reading data from redis.
24
kSlave
,
///< It may be no slaves on unstable. Waiting can always fail.
25
kMasterAndSlave
,
///< It may be no slaves on unstable.
26
};
20
enum
class
WaitConnectedMode
{
…
};
27
28
std::string ToString(
WaitConnectedMode
mode);
29
30
WaitConnectedMode
Parse(
const
std::string& str,
formats
::
parse
::
To
<
WaitConnectedMode
>);
31
32
/// Connection wait options for the Redis; mostly used by storages::redis::Client::WaitConnectedOnce.
33
struct
RedisWaitConnected
{
34
WaitConnectedMode
mode{
WaitConnectedMode
::
kNoWait
};
35
bool
throw_on_fail{
false
};
36
std::chrono::milliseconds timeout{
kRedisWaitConnectedDefaultTimeout
};
37
38
RedisWaitConnected
MergeWith(
const
testsuite
::
RedisControl
& t)
const
;
39
};
33
struct
RedisWaitConnected
{
…
};
40
41
}
// namespace storages::redis
42
43
USERVER_NAMESPACE_END
userver
storages
redis
wait_connected_mode.hpp
Generated on Fri Apr 11 2025 14:24:33 for userver by
Doxygen
1.13.2