forked from envoyproxy/nighthawk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremote_process_impl.h
45 lines (37 loc) · 1.35 KB
/
remote_process_impl.h
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
36
37
38
39
40
41
42
43
44
45
#pragma once
#include "nighthawk/client/options.h"
#include "nighthawk/client/output_collector.h"
#include "nighthawk/client/process.h"
#include "external/envoy/source/common/common/logger.h"
#include "api/client/service.grpc.pb.h"
namespace Nighthawk {
namespace Client {
/**
* Will delegate execution to a remote nighthawk_service using gRPC.
*/
class RemoteProcessImpl : public Process, public Envoy::Logger::Loggable<Envoy::Logger::Id::main> {
public:
/**
* @param options Options to send to the remote nighthawk service, as well as
* containing information to connect to it (which won't be forwarded).
* @param stub Stub that will be used to communicate with the remote
* gRPC server.
*/
RemoteProcessImpl(const Options& options, nighthawk::client::NighthawkService::Stub& stub);
/**
* @param collector Collects the output from the remote nighthawk service.
* @return true iff the remote execution should be considered successful. Unsuccessful execution
* will log available error details.
*/
bool run(OutputCollector& collector) override;
/**
* Shuts down the service, a no-op in this implementation.
*/
void shutdown() override{};
bool requestExecutionCancellation() override;
private:
const Options& options_;
nighthawk::client::NighthawkService::Stub& stub_;
};
} // namespace Client
} // namespace Nighthawk