aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/retriever/genericconfigsubscriber.cpp
blob: 93001518b32de8b47fafdf7cb638e1d1f293e337 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "genericconfigsubscriber.h"

namespace config {

GenericConfigSubscriber::GenericConfigSubscriber(std::shared_ptr<IConfigContext> context)
    : _set(std::move(context))
{ }

bool
GenericConfigSubscriber::nextGeneration(vespalib::duration timeout)
{
    return _set.acquireSnapshot(timeout, true);
}

std::shared_ptr<ConfigSubscription>
GenericConfigSubscriber::subscribe(const ConfigKey & key, vespalib::duration timeout)
{
    return _set.subscribe(key, timeout);
}

void
GenericConfigSubscriber::close()
{
    _set.close();
}

int64_t
GenericConfigSubscriber::getGeneration() const
{
    return _set.getGeneration();
}

}