// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include #include #include 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::UP _modelHandle; std::unique_ptr _modelConfig; public: ModelOwner(const std::string &configId); virtual ~ModelOwner(); void start(std::chrono::milliseconds timeout); void checkForUpdates(); std::optional getModelConfig(); }; }