summaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/retriever/genericconfigsubscriber.cpp
blob: c2a7e05d538c83b89dc0bc3ebe7b3e769f24643d (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 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "genericconfigsubscriber.h"

namespace config {

GenericConfigSubscriber::GenericConfigSubscriber(const IConfigContext::SP & context)
    : _set(context)
{ }

bool
GenericConfigSubscriber::nextGeneration(int timeoutInMillis)
{
    return _set.acquireSnapshot(timeoutInMillis, true);
}

ConfigSubscription::SP
GenericConfigSubscriber::subscribe(const ConfigKey & key, int timeoutInMillis)
{
    return _set.subscribe(key, timeoutInMillis);
}

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

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

}