#include <userver/utils/periodic_task.hpp>
Configuration parameters for PeriodicTask.
Definition at line 59 of file periodic_task.hpp.
Public Member Functions | |
constexpr | Settings (std::chrono::milliseconds period, utils::Flags< Flags > flags={}, logging::Level span_level=logging::Level::kInfo) |
constexpr | Settings (std::chrono::milliseconds period, std::chrono::milliseconds distribution, utils::Flags< Flags > flags={}, logging::Level span_level=logging::Level::kInfo) |
constexpr | Settings (std::chrono::milliseconds period, uint8_t distribution_percent, utils::Flags< Flags > flags={}, logging::Level span_level=logging::Level::kInfo) |
template<class Rep , class Period > | |
constexpr | Settings (std::chrono::duration< Rep, Period > period) |
Public Attributes | |
std::chrono::milliseconds | period {} |
Period for the task execution. Task is repeated every (period +/- distribution) - time of previous execution | |
std::chrono::milliseconds | distribution {} |
Jitter for task repetitions. If kChaotic is set in flags the task is repeated every (period +/- distribution) - time of previous execution | |
std::optional< std::chrono::milliseconds > | exception_period |
Used instead of period in case of exception, if set. | |
utils::Flags< Flags > | flags {} |
Flags that control the behavior of PeriodicTask. | |
logging::Level | span_level {logging::Level::kInfo} |
tracing::Span that measures each execution of the task uses this logging level. | |
engine::TaskProcessor * | task_processor {nullptr} |
TaskProcessor to execute the task. If nullptr then the PeriodicTask::Start() calls engine::current_task::GetTaskProcessor() to get the TaskProcessor. | |
Static Public Attributes | |
static constexpr uint8_t | kDistributionPercent = 25 |
|
inlineconstexpr |
Definition at line 62 of file periodic_task.hpp.
|
inlineconstexpr |
Definition at line 69 of file periodic_task.hpp.
|
inlineconstexpr |
Definition at line 79 of file periodic_task.hpp.
|
inlineconstexpr |
Definition at line 90 of file periodic_task.hpp.
std::chrono::milliseconds utils::PeriodicTask::Settings::distribution {} |
Jitter for task repetitions. If kChaotic is set in flags
the task is repeated every (period +/- distribution) - time of previous execution
Definition at line 103 of file periodic_task.hpp.
std::optional<std::chrono::milliseconds> utils::PeriodicTask::Settings::exception_period |
Used instead of period
in case of exception, if set.
Definition at line 106 of file periodic_task.hpp.
utils::Flags<Flags> utils::PeriodicTask::Settings::flags {} |
Flags that control the behavior of PeriodicTask.
Definition at line 109 of file periodic_task.hpp.
Definition at line 60 of file periodic_task.hpp.
std::chrono::milliseconds utils::PeriodicTask::Settings::period {} |
Period for the task execution. Task is repeated every (period +/- distribution) - time of previous execution
Definition at line 98 of file periodic_task.hpp.
logging::Level utils::PeriodicTask::Settings::span_level {logging::Level::kInfo} |
tracing::Span that measures each execution of the task uses this logging level.
Definition at line 113 of file periodic_task.hpp.
engine::TaskProcessor* utils::PeriodicTask::Settings::task_processor {nullptr} |
TaskProcessor to execute the task. If nullptr then the PeriodicTask::Start() calls engine::current_task::GetTaskProcessor() to get the TaskProcessor.
Definition at line 118 of file periodic_task.hpp.