9#include <userver/dist_lock/dist_lock_settings.hpp>
10#include <userver/dist_lock/dist_lock_strategy.hpp>
11#include <userver/dist_lock/statistics.hpp>
12#include <userver/engine/mutex.hpp>
13#include <userver/engine/task/task_with_result.hpp>
14#include <userver/logging/level.hpp>
16USERVER_NAMESPACE_BEGIN
28class DistLockedWorker
final {
30 using WorkerFunc = std::function<
void()>;
46 WorkerFunc worker_func,
49 engine::TaskProcessor* task_processor =
nullptr,
56 const std::string&
Name()
const;
91 engine::TaskProcessor& GetTaskProcessor()
const noexcept;
93 std::shared_ptr<impl::Locker> locker_ptr_;
95 mutable engine::Mutex locker_task_mutex_;
98 engine::TaskProcessor*
const task_processor_;
101void DumpMetric(
utils::statistics::Writer& writer,
const DistLockedWorker& worker);