Component that stores the runtime config.
Static options:
Name | Description | Default value |
fs-cache-path | path to the file to read and dump a config cache; set to empty string to disable reading and dumping configs to FS | - |
fs-task-processor | name of the task processor to run the blocking file write operations | - |
Static configuration example:
# yaml
dynamic-config:
fs-
cache-path: $runtime_config_path
fs-task-processor:
fs-task-processor
Usage example:
namespace myservice::smth {
namespace {
return docs_map.Get(
"SAMPLE_INTEGER_FROM_RUNTIME_CONFIG").
As<
int>();
}
}
int Component::DoSomething() const {
const auto runtime_config = config_.GetSnapshot();
return runtime_config[kMyConfig];
}
}
- Examples
- components/component_sample_test.cpp.
Definition at line 41 of file component.hpp.