diff options
author | Arne Juul <arnej@verizonmedia.com> | 2021-06-11 13:24:18 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2021-06-11 13:24:51 +0000 |
commit | 714a924518bc5bef4f920899d3af96b56497eaf0 (patch) | |
tree | 6cea53d7a64aedeb4efda6680487dd5e9dc0f26c /configd/src/apps/sentinel/model-owner.h | |
parent | d32a461a49354922d81e55aabddbd13cc8902c30 (diff) |
keep naming convention
Diffstat (limited to 'configd/src/apps/sentinel/model-owner.h')
-rw-r--r-- | configd/src/apps/sentinel/model-owner.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/configd/src/apps/sentinel/model-owner.h b/configd/src/apps/sentinel/model-owner.h new file mode 100644 index 00000000000..d03e7dec06d --- /dev/null +++ b/configd/src/apps/sentinel/model-owner.h @@ -0,0 +1,30 @@ +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#pragma once + +#include <vespa/config-model.h> +#include <vespa/config/config.h> +#include <optional> + +using cloud::config::ModelConfig; + +namespace config::sentinel { + +/** + * Handles config subscription and has a snapshot of current config. + **/ +class ModelOwner { +private: + std::string _configId; + config::ConfigSubscriber _subscriber; + config::ConfigHandle<ModelConfig>::UP _modelHandle; + std::unique_ptr<ModelConfig> _modelConfig; +public: + ModelOwner(const std::string &configId); + virtual ~ModelOwner(); + void start(std::chrono::milliseconds timeout); + void checkForUpdates(); + std::optional<ModelConfig> getModelConfig(); +}; + +} |