userver
C++ Async Framework
Loading...
Searching...
No Matches
limiter.hpp
1
#
pragma
once
2
3
#
include
<
optional
>
4
#
include
<
string
>
5
6
USERVER_NAMESPACE_BEGIN
7
8
namespace
congestion_control
{
9
10
struct
Limit
{
11
std::optional<size_t> load_limit;
12
size_t current_load{0};
13
14
std::string ToLogString() {
15
return
"limit="
+
16
(load_limit ? std::to_string(*load_limit) : std::string(
"(none)"
));
17
}
18
};
19
20
class
Limiter
{
21
public
:
22
virtual
void
SetLimit(
const
Limit
& new_limit) = 0;
23
24
protected
:
25
~Limiter() =
default
;
26
};
27
28
}
// namespace congestion_control
29
30
USERVER_NAMESPACE_END
userver
congestion_control
limiter.hpp
Generated on Wed May 15 2024 22:17:42 for userver by
Doxygen
1.10.0