aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/retriever/genericconfigsubscriber.h
blob: f519d71be14a2c8a21fdbc0ff6fda33cdc8d0fa6 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/config/subscription/configsubscriptionset.h>

namespace config {

/**
 * The GenericConfigSubscriber is a generic form of a config subscriber, which
 * does not require any type to be known. It also only supports generation
 * changes.
 */
class GenericConfigSubscriber
{
public:
    GenericConfigSubscriber(std::shared_ptr<IConfigContext> context);
    bool nextGeneration(vespalib::duration timeout);
    std::shared_ptr<ConfigSubscription> subscribe(const ConfigKey & key, vespalib::duration timeout);
    void close();
    int64_t getGeneration() const;
private:
    ConfigSubscriptionSet _set;
};

} // namespace config