#include <stdbool.h>
#include <stdint.h>
#include <common/xroad_common_types.h>
Go to the source code of this file.
- Author
- Sergey Kovalevich
-
Andrey Arbuzov-Matveev
◆ xroad_rate_control_allow_to_process()
bool xroad_rate_control_allow_to_process |
( |
xroad_rate_control_t * |
ctx, |
|
|
xroad_timestamp_t |
current_time |
|
) |
| |
Check if event/message/etc is allow to be processed
- Parameters
-
[in] | ctx | - pointer to control structure |
[in] | current_time | - the current time, which must be greater than or equal to the time of the previous check |
- Returns
- True if event could be processed and false otherwise
◆ xroad_rate_control_clear()
Clear rate control
- Parameters
-
[in] | ctx | - pointer to control structure |
◆ xroad_rate_control_init()
Init rate control struct
- Parameters
-
[in] | ctx | - pointer to control structure |
◆ xroad_rate_control_processed()
Update rate control allowance
- Parameters
-
[in] | ctx | - pointer to control structure |
◆ xroad_rate_control_set_options()
xroad_errno_t xroad_rate_control_set_options |
( |
xroad_rate_control_t * |
ctx, |
|
|
uint64_t |
rate, |
|
|
xroad_timestamp_t |
per |
|
) |
| |
Set rate control options
- Parameters
-
[in] | ctx | - pointer to control structure |
[in] | rate | - number of events/messages/etc... per interval |
[in] | per | - rate interval |
- Returns
- XROAD_OK - success, XROAD_ERROR_NO_MORE_RESOURCES - no more memory, XROAD_ERROR_INVALID_ARG - invalid arguments