Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
central_controller_rpc_server.h
Go to the documentation of this file.
1 #ifndef PAGESPEED_CONTROLLER_CENTRAL_CONTROLLER_RPC_SERVER_H_
2 #define PAGESPEED_CONTROLLER_CENTRAL_CONTROLLER_RPC_SERVER_H_
3 
4 // Copyright 2016 Google Inc.
19 
20 #include <memory>
21 
22 #include "base/macros.h"
23 #include "pagespeed/controller/controller.grpc.pb.h"
30 
31 namespace net_instaweb {
32 
35 
37  public:
43  const GoogleString& listen_address,
44  ExpensiveOperationController* expensive_operation_controller,
45  ScheduleRewriteController* rewrite_controller,
46  MessageHandler* handler);
47  virtual ~CentralControllerRpcServer() { }
48 
50  int Setup() override;
51  int Run() override;
52  void Stop() override;
53 
55  static void MainLoop(::grpc::CompletionQueue* queue);
56 
57  private:
58  const GoogleString listen_address_;
59  std::unique_ptr<::grpc::Server> server_;
60  std::unique_ptr<::grpc::ServerCompletionQueue> queue_;
61  grpc::CentralControllerRpcService::AsyncService service_;
62 
63  std::unique_ptr<ExpensiveOperationController> expensive_operation_controller_;
64  std::unique_ptr<ScheduleRewriteController> rewrite_controller_;
65  MessageHandler* handler_;
66 
67 
68 };
69 
70 }
71 
72 #endif
int Setup() override
ControllerProcess implementation.
Definition: expensive_operation_controller.h:28
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
static void MainLoop(::grpc::CompletionQueue *queue)
Pulled out into a static function so it can also be used in tests.
Definition: controller_process.h:39
Definition: message_handler.h:39
CentralControllerRpcServer(const GoogleString &listen_address, ExpensiveOperationController *expensive_operation_controller, ScheduleRewriteController *rewrite_controller, MessageHandler *handler)
Definition: schedule_rewrite_controller.h:30
Definition: central_controller_rpc_server.h:36