12#include <userver/dist_lock/dist_lock_settings.hpp>
13#include <userver/dist_lock/dist_lock_strategy.hpp>
14#include <userver/engine/task/task_base.hpp>
15#include <userver/engine/task/task_processor_fwd.hpp>
17USERVER_NAMESPACE_BEGIN
48class DistLockedTask
final :
public engine::
TaskBase {
50 using WorkerFunc = std::function<
void()>;
56 DistLockedTask(DistLockedTask&&) =
delete;
57 DistLockedTask& operator=(DistLockedTask&&) =
delete;
59 DistLockedTask(
const DistLockedTask&) =
delete;
60 DistLockedTask& operator=(
const DistLockedTask&&) =
delete;
76 WorkerFunc worker_func,
85 engine::TaskProcessor& task_processor,
87 WorkerFunc worker_func,
98 void Get()
noexcept(
false);
101 DistLockedTask(engine::TaskProcessor&, std::shared_ptr<impl::Locker>,
DistLockWaitingMode);
103 std::shared_ptr<impl::Locker> locker_ptr_;