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() {
return
"limit="
+ (load_limit ? std::to_string(*load_limit) : std::string(
"(none)"
)); }
15
};
16
17
class
Limiter
{
18
public
:
19
virtual
void
SetLimit(
const
Limit
& new_limit) = 0;
20
21
protected
:
22
~Limiter() =
default
;
23
};
24
25
}
// namespace congestion_control
26
27
USERVER_NAMESPACE_END
userver
congestion_control
limiter.hpp
Generated on Wed Dec 4 2024 18:42:04 for userver by
Doxygen
1.10.0