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>
15USERVER_NAMESPACE_BEGIN
27class DistLockedWorker
final {
29 using WorkerFunc = std::function<
void()>;
45 engine::TaskProcessor* task_processor =
nullptr);
50 const std::string&
Name()
const;
82 engine::TaskProcessor& GetTaskProcessor()
const noexcept;
84 std::shared_ptr<impl::Locker> locker_ptr_;
86 mutable engine::Mutex locker_task_mutex_;
89 engine::TaskProcessor*
const task_processor_;
92void DumpMetric(utils::statistics::Writer& writer,
93 const DistLockedWorker& worker);