Page Speed Optimization Libraries  1.12.34.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
net_instaweb::CentralControllerRpcServer Class Reference

#include "central_controller_rpc_server.h"

Inheritance diagram for net_instaweb::CentralControllerRpcServer:
net_instaweb::ControllerProcess

Public Member Functions

 CentralControllerRpcServer (const GoogleString &listen_address, ExpensiveOperationController *expensive_operation_controller, ScheduleRewriteController *rewrite_controller, MessageHandler *handler)
 
int Setup () override
 ControllerProcess implementation.
 
int Run () override
 
void Stop () override
 

Static Public Member Functions

static void MainLoop (::grpc::CompletionQueue *queue)
 Pulled out into a static function so it can also be used in tests.
 

Detailed Description

ControllerProcess implementation that starts a gRPC server which handles CentralController operations.

Constructor & Destructor Documentation

net_instaweb::CentralControllerRpcServer::CentralControllerRpcServer ( const GoogleString listen_address,
ExpensiveOperationController expensive_operation_controller,
ScheduleRewriteController rewrite_controller,
MessageHandler handler 
)

listen_address is passed directly into ServerBuilder::AddListeningPort, so theoretically it can be anything gRPC supports. In practice we expect it to be either "localhost:<port>" or "unix:<path>". This takes ownership of rewrite_controller.

Member Function Documentation

int net_instaweb::CentralControllerRpcServer::Run ( )
overridevirtual

Perform your work and return the exit status. Invoked only if Setup() returns 0. Stop() may be called before Run(), in which case Run() should return immediately.

The babysitter respawns the child whenever it dies for any reason other than exit(0). Thus, if the child is dying because it was asked to by the parent process (ie: Stop() was called) the return value of Run() is ignored and an exit status of 0 will be used.

Implements net_instaweb::ControllerProcess.

void net_instaweb::CentralControllerRpcServer::Stop ( )
overridevirtual

Notify the Run() thread to stop. Called from a different thread so must be thread safe. May be called before, during or after Run(), possibly multiple times.

Implements net_instaweb::ControllerProcess.


The documentation for this class was generated from the following file: