6#include <userver/components/component_base.hpp>
7#include <userver/dist_lock/dist_locked_worker.hpp>
8#include <userver/dynamic_config/snapshot.hpp>
9#include <userver/dynamic_config/source.hpp>
10#include <userver/storages/postgres/dist_lock_strategy.hpp>
12USERVER_NAMESPACE_BEGIN
14namespace storages::postgres {
66 DistLockComponentBase(
const components::ComponentConfig&,
const components::ComponentContext&);
68 ~DistLockComponentBase() override;
75 static yaml_config::Schema GetStaticConfigSchema();
128 bool ShouldRunOnHost(
const dynamic_config::Snapshot& config)
const;
129 void OnConfigUpdate(
const dynamic_config::Diff& diff);
131 dynamic_config::Source config_;
132 const std::string name_;
133 const std::string real_host_name_;
134 std::unique_ptr<
dist_lock::DistLockedWorker> worker_;
136 bool testsuite_enabled_{
false};
139 concurrent::AsyncEventSubscriberScope subscription_token_;