#include <userver/dynamic_config/storage/component.hpp>
Allows to subscribe to DynamicConfig updates without waiting for the first update to complete. Primarily intended for internal use.
Definition at line 94 of file component.hpp.
Public Member Functions | |
| NoblockSubscriber (DynamicConfig &config_component) noexcept | |
| NoblockSubscriber (NoblockSubscriber &&)=delete | |
| NoblockSubscriber & | operator= (NoblockSubscriber &&)=delete |
| template<typename Class> | |
| concurrent::AsyncEventSubscriberScope | UpdateIfHasConfigAndListen (Class *obj, std::string_view name, void(Class::*func)(const dynamic_config::Diff &diff)) |
| Subscribes to dynamic-config updates with information about the current and previous states. | |
|
inline |
Subscribes to dynamic-config updates with information about the current and previous states.
Subscribes to dynamic-config updates using a member function, named OnConfigUpdate by convention. actual configs values are already loaded, also constructs dynamic_config::Diff object using std::nullopt and current config snapshot, then immediately invokes the function with it (this invocation will be executed synchronously).
std::nullopt and current config snapshot.Example usage:
| obj | the subscriber, which is the owner of the listener method, and is also used as the unique identifier of the subscription |
| name | the name of the subscriber, for diagnostic purposes |
| func | the listener method, named OnConfigUpdate by convention. |
Unsubscribe should be called explicitlyDefinition at line 130 of file component.hpp.