summaryrefslogtreecommitdiffstats
path: root/configd/src/apps/sentinel/outward-check.h
blob: 8a0b036ac491817b3c91c779ebd8fb3bdadb2490 (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
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include <string>
#include <vespa/vespalib/util/count_down_latch.h>
#include <vespa/fnet/frt/supervisor.h>
#include <vespa/fnet/frt/invoker.h>
#include <vespa/fnet/frt/rpcrequest.h>
#include <vespa/fnet/frt/supervisor.h>
#include <vespa/fnet/frt/target.h>

namespace config::sentinel {

class OutwardCheck  : public FRT_IRequestWait {
private:
    bool _wasOk = false;
    bool _wasBad = false;
    FRT_Target *_target = nullptr;
    FRT_RPCRequest *_req = nullptr;
    std::string _spec;
    vespalib::CountDownLatch &_countDownLatch;
public:
    OutwardCheck(const std::string &spec, const char * myHostname, int myPortnum,
                 FRT_Supervisor &orb, vespalib::CountDownLatch &latch);
    virtual ~OutwardCheck();
    void RequestDone(FRT_RPCRequest *req) override;
    bool ok() const { return _wasOk; }
    bool bad() const { return _wasBad; }
};

}