10#include <userver/components/component_base.hpp>
11#include <userver/concurrent/async_event_source.hpp>
12#include <userver/dynamic_config/snapshot.hpp>
13#include <userver/dynamic_config/source.hpp>
14#include <userver/dynamic_config/updates_sink/component.hpp>
15#include <userver/utils/fast_pimpl.hpp>
17USERVER_NAMESPACE_BEGIN
73 class NoblockSubscriber;
75 DynamicConfig(
const ComponentConfig&,
const ComponentContext&);
76 ~DynamicConfig()
override;
90 void OnLoadingCancelled()
override;
92 void SetConfig(std::string_view updater, dynamic_config::DocsMap&& value)
override;
94 void SetConfig(std::string_view updater,
const dynamic_config::DocsMap& value)
override;
96 void NotifyLoadingFailed(std::string_view updater, std::string_view error)
override;
99 std::unique_ptr<Impl> impl_;
104class DynamicConfig::NoblockSubscriber
final {
106 explicit NoblockSubscriber(DynamicConfig& config_component)
noexcept;
108 NoblockSubscriber(NoblockSubscriber&&) =
delete;
109 NoblockSubscriber& operator=(NoblockSubscriber&&) =
delete;
111 concurrent::AsyncEventSource<
const dynamic_config::Snapshot&>& GetEventSource()
noexcept;
114 DynamicConfig& config_component_;
118inline constexpr bool kHasValidate<DynamicConfig> =
true;