userver
C++ Async Framework
Loading...
Searching...
No Matches
limiter.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/congestion_control/limiter.hpp
4
/// @brief @copybrief congestion_control::Limiter
5
6
#
include
<
optional
>
7
#
include
<
string
>
8
9
USERVER_NAMESPACE_BEGIN
10
11
namespace
congestion_control
{
12
13
struct
Limit
{
14
std::optional<std::size_t> load_limit;
15
std::size_t current_load{0};
16
17
std::string ToLogString()
const
{
18
return
"limit="
+ (load_limit ? std::to_string(*load_limit) : std::string(
"(none)"
));
19
}
20
};
21
22
/// @brief Applies congestion control load limits
23
class
Limiter
{
24
public
:
25
virtual
void
SetLimit(
const
Limit
& new_limit) = 0;
26
27
protected
:
28
~Limiter() =
default
;
29
};
30
31
}
// namespace congestion_control
32
33
USERVER_NAMESPACE_END
userver
congestion_control
limiter.hpp
Generated on Thu May 21 2026 16:16:03 for userver by
Doxygen
1.13.2