|
drogon
C++14/17-based HTTP application framework
|
This class is used to limit the number of requests per second. More...
#include <drogon/RateLimiter.h>

Public Member Functions | |
| virtual bool | isAllowed ()=0 |
| Check if a request is allowed. | |
Static Public Member Functions | |
| static RateLimiterPtr | newRateLimiter (RateLimiterType type, size_t capacity, std::chrono::duration< double > timeUnit=std::chrono::seconds(60)) |
| Create a rate limiter. | |
This class is used to limit the number of requests per second.
|
pure virtual |
Check if a request is allowed.
Implemented in drogon::SafeRateLimiter.
|
static |
Create a rate limiter.
| type | The type of the rate limiter |
| capacity | The maximum number of requests in the time unit. |
| timeUnit | The time unit of the rate limiter. |