Github   Telegram
Loading...
Searching...
No Matches
dist_lock_component_base.hpp
Go to the documentation of this file.
1#pragma once
2
5
7#include <userver/dist_lock/dist_locked_worker.hpp>
9#include <userver/storages/mongo/dist_lock_strategy.hpp>
11
12USERVER_NAMESPACE_BEGIN
13
14namespace storages::mongo {
15
16// clang-format off
17
56
57// clang-format on
58
60 public:
64
65 ~DistLockComponentBase() override;
66
67 dist_lock::DistLockedWorker& GetWorker();
68
69 static yaml_config::Schema GetStaticConfigSchema();
70
71 protected:
99 virtual void DoWork() = 0;
100
102 virtual void DoWorkTestsuite() { DoWork(); }
103
105 void Start();
106
108 void Stop();
109
110 private:
111 std::unique_ptr<dist_lock::DistLockedWorker> worker_;
112 utils::statistics::Entry statistics_holder_;
113 bool testsuite_enabled_{false};
114};
115
116} // namespace storages::mongo
117
118USERVER_NAMESPACE_END