#include <userver/dynamic_config/updater/component.hpp>
Component that does a periodic update of runtime configs.
Note that the service with dynamic config update component and without configs cache requires successful update to start. See dynamic_config_fallback for details and explanation.
Config update types to deduplicate. If enabled, JSON of the whole config is compared to the previous one; if same, no config update event is sent to the subscribers of dynamic_config::Source (OnConfigUpdate
functions).
deduplicate-update-types
static config option specifies the update types of the config cache, for which event deduplication should be performed. Possible values:
none
(the default)only-full
only-incremental
full-and-incremental
Full updates will always send an event unless deduplicated. Incremental updates may send an extra event for some config service implementations.
Note: This is not a silver bullet against extra events, because the events will be sent to every dynamic config subscriber if any part of the config has updated, not if the interesting part has updated.
Name | Description | Default value |
---|---|---|
updates-sink | name of the component derived from components::DynamicConfigUpdatesSinkBase to be used for storing received updates | dynamic-config |
store-enabled | store the retrieved values into the updates sink determined by the updates-sink option | true |
load-only-my-values | request from the client only the values used by this service | true |
deduplicate-update-types | update types for best-effort update event deduplication, see above | full-and-incremental |
See also the options for components::CachingComponentBase.
Definition at line 76 of file component.hpp.
Static Public Member Functions | |
static yaml_config::Schema | GetStaticConfigSchema () |
Static Public Member Functions inherited from components::CachingComponentBase< dynamic_config::DocsMap > | |
static yaml_config::Schema | GetStaticConfigSchema () |
Static Public Member Functions inherited from components::LoggableComponentBase | |
static yaml_config::Schema | GetStaticConfigSchema () |
Static Public Attributes | |
static constexpr std::string_view | kName = "dynamic-config-client-updater" |
The default name of components::DynamicConfigClientUpdater. | |
Additional Inherited Members | |
Public Types inherited from components::CachingComponentBase< dynamic_config::DocsMap > | |
using | DataType |
Protected Types inherited from cache::CacheUpdateTrait | |
enum class | Flag { kNone = 0 , kNoFirstUpdate = 1 << 0 } |
Periodic update flags. More... | |
Protected Member Functions inherited from components::CachingComponentBase< dynamic_config::DocsMap > | |
void | Set (std::unique_ptr< const dynamic_config::DocsMap > value_ptr) |
void | Set (dynamic_config::DocsMap &&value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | Emplace (Args &&... args) |
void | Clear () |
Clears the content of the cache by string a default constructed T. | |
virtual bool | MayReturnNull () const |
virtual void | PreAssignCheck (const dynamic_config::DocsMap *old_value_ptr, const dynamic_config::DocsMap *new_value_ptr) const |
If the option has-pre-assign-check is set true in static config, this function is called before assigning the new value to the cache. | |
virtual void | WriteContents (dump::Writer &writer, const dynamic_config::DocsMap &contents) const |
virtual std::unique_ptr< const dynamic_config::DocsMap > | ReadContents (dump::Reader &reader) const |
Protected Member Functions inherited from cache::CacheUpdateTrait | |
AllowedUpdateTypes | GetAllowedUpdateTypes () const |
Update types configured for the cache. | |
void | StartPeriodicUpdates (utils::Flags< Flag > flags={}) |
Starts periodic updates. | |
void | StopPeriodicUpdates () |
Stops periodic updates. | |
void | AssertPeriodicUpdateStarted () |
void | OnCacheModified () |
CacheUpdateTrait (CacheUpdateTrait &&)=delete | |
CacheUpdateTrait & | operator= (CacheUpdateTrait &&)=delete |
void | InvalidateAsync (UpdateType update_type) |
Non-blocking forced cache update of specified type. | |
void | UpdateSyncDebug (UpdateType update_type) |
Forces a cache update of specified type. | |
const std::string & | Name () const |