aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/flushengine/priority_flush_token.h
blob: 82048b3eb3f1fcb096b52e2306f80848b00ec369 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/vespalib/util/idestructorcallback.h>
#include <future>

namespace proton {

/*
 * This token is shared between flushes initiated from a priority flush
 * strategy (cf. Proton::triggerFLush and Proton::prepareRestart).
 */
class PriorityFlushToken : public vespalib::IDestructorCallback {
    std::promise<void> _promise;
public:
    PriorityFlushToken(std::promise<void> promise);
    ~PriorityFlushToken() override;
};

}