aboutsummaryrefslogtreecommitdiffstats
path: root/slobrok/src/vespa/slobrok/server/rpcmirror.h
blob: 52cf455c0e0fcdea1d96ac299d3f93c275fc86e6 (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
35
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "service_map_history.h"
#include <vespa/fnet/task.h>
#include <vespa/vespalib/util/gencnt.h>

class FRT_RPCRequest;
class FRT_Supervisor;

namespace slobrok {

class IncrementalFetch : public FNET_Task,
                         public ServiceMapHistory::DiffCompletionHandler
{
private:
    FRT_RPCRequest *_req;
    ServiceMapHistory &_smh;
    vespalib::GenCnt _gen;

public:
    IncrementalFetch(const IncrementalFetch &) = delete;
    IncrementalFetch& operator=(const IncrementalFetch &) = delete;

    IncrementalFetch(FRT_Supervisor *orb, FRT_RPCRequest *req, ServiceMapHistory &smh, vespalib::GenCnt gen);
    ~IncrementalFetch();

    void completeReq(MapDiff diff);
    void PerformTask() override;
    void handle(MapDiff diff) override;
    void invoke(uint32_t msTimeout);
};

} // namespace slobrok