summaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/helper/configpoller.hpp
blob: 4088a311609624d20a1f99dcbbbcac812b9ab744 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

namespace config {

template <typename ConfigType>
void
ConfigPoller::subscribe(const std::string & configId, IFetcherCallback<ConfigType> * callback, milliseconds subscribeTimeout)
{
    std::unique_ptr<ConfigHandle<ConfigType> > handle(_subscriber.subscribe<ConfigType>(configId, subscribeTimeout));
    _handleList.emplace_back(std::make_unique<GenericHandle<ConfigType>>(std::move(handle)));
    _callbackList.push_back(callback);
}

} // namespace config