userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
dist_lock_settings.hpp
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <chrono>
7
#include <cstddef>
8
#include <optional>
9
10
USERVER_NAMESPACE_BEGIN
11
13
namespace
dist_lock
{
14
16
struct
DistLockFallbackSettings
{
18
std::size_t
fallback_after_checks
{50};
19
21
std::chrono::milliseconds
fallback_duration
{std::chrono::minutes{10}};
22
24
bool
operator==
(
const
DistLockFallbackSettings
&)
const
=
default
;
25
};
26
28
struct
DistLockSettings
{
30
std::chrono::milliseconds
acquire_interval
{100};
31
33
std::chrono::milliseconds
prolong_interval
{100};
34
36
std::chrono::milliseconds
lock_ttl
{1000};
37
40
std::chrono::milliseconds
forced_stop_margin
{50};
41
43
std::chrono::milliseconds
worker_func_restart_delay
{100};
44
49
bool
is_enabled
{
true
};
50
52
std::optional<DistLockFallbackSettings>
fallback_policy
{};
53
57
bool
is_host_deprioritized
{
false
};
58
60
bool
operator==
(
const
DistLockSettings
&)
const
=
default
;
61
};
62
64
enum class
DistLockWaitingMode
{
65
kWait
,
66
kNoWait
,
67
};
68
70
enum class
DistLockRetryMode
{
71
kRetry
,
72
kSingleAttempt
,
73
};
74
75
}
// namespace dist_lock
76
77
USERVER_NAMESPACE_END
userver
dist_lock
dist_lock_settings.hpp
Generated on
for userver by
Doxygen
1.17.0