userver: utils::PeriodicTask::Settings Struct Reference
Loading...
Searching...
No Matches
utils::PeriodicTask::Settings Struct Referencefinal

#include <userver/utils/periodic_task.hpp>

Detailed Description

Configuration parameters for PeriodicTask.

Definition at line 59 of file periodic_task.hpp.

+ Collaboration diagram for utils::PeriodicTask::Settings:

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< Flagsflags {}
 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
 

Constructor & Destructor Documentation

◆ Settings() [1/4]

constexpr utils::PeriodicTask::Settings::Settings ( std::chrono::milliseconds period,
utils::Flags< Flags > flags = {},
logging::Level span_level = logging::Level::kInfo )
inlineconstexpr

Definition at line 62 of file periodic_task.hpp.

◆ Settings() [2/4]

constexpr utils::PeriodicTask::Settings::Settings ( std::chrono::milliseconds period,
std::chrono::milliseconds distribution,
utils::Flags< Flags > flags = {},
logging::Level span_level = logging::Level::kInfo )
inlineconstexpr

Definition at line 67 of file periodic_task.hpp.

◆ Settings() [3/4]

constexpr utils::PeriodicTask::Settings::Settings ( std::chrono::milliseconds period,
uint8_t distribution_percent,
utils::Flags< Flags > flags = {},
logging::Level span_level = logging::Level::kInfo )
inlineconstexpr

Definition at line 78 of file periodic_task.hpp.

◆ Settings() [4/4]

template<class Rep , class Period >
constexpr utils::PeriodicTask::Settings::Settings ( std::chrono::duration< Rep, Period > period)
inlineconstexpr

Definition at line 88 of file periodic_task.hpp.

Member Data Documentation

◆ distribution

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 101 of file periodic_task.hpp.

◆ exception_period

std::optional<std::chrono::milliseconds> utils::PeriodicTask::Settings::exception_period

Used instead of period in case of exception, if set.

Definition at line 104 of file periodic_task.hpp.

◆ flags

utils::Flags<Flags> utils::PeriodicTask::Settings::flags {}

Flags that control the behavior of PeriodicTask.

Definition at line 107 of file periodic_task.hpp.

◆ kDistributionPercent

constexpr uint8_t utils::PeriodicTask::Settings::kDistributionPercent = 25
staticconstexpr

Definition at line 60 of file periodic_task.hpp.

◆ period

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 96 of file periodic_task.hpp.

◆ span_level

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 111 of file periodic_task.hpp.

◆ task_processor

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 116 of file periodic_task.hpp.


The documentation for this struct was generated from the following file: