Page Speed Optimization Libraries
1.13.35.1
|
#include "central_controller_rpc_client.h"
Public Member Functions | |
CentralControllerRpcClient (const GoogleString &server_address, int panic_threshold, ThreadSystem *thread_system, Timer *timer, Statistics *statistics, MessageHandler *handler) | |
void | ScheduleExpensiveOperation (ExpensiveOperationCallback *callback) override |
CentralController implementation. | |
void | ScheduleRewrite (ScheduleRewriteCallback *callback) override |
void | ShutDown () override LOCKS_EXCLUDED(mutex_) |
Static Public Member Functions | |
static void | InitStats (Statistics *stats) |
Static Public Attributes | |
static const char | kControllerReconnectTimeStatistic [] |
static const int | kControllerReconnectDelayMs |
CentralController implementation that forwards all requests to a gRPC server. RewriteDrivers wait for the controller response (possibly detaching) before proceeding to rewrite. If the controller stops responding but requests keep coming in, we could keep creating RewriteDrivers indefinitely and eat all available memory. To guard against this we looks at the number of outstanding gRPC requests. If that ever exceeds the max possible number, we declare the controller to have hung, cancel all outstanding requests and stop talking to it. We signal this via a statistic, so all processes can notice and do the same.
|
overridevirtual |
Runs callback at an indeterminate time in the future when the associated rewrite should be performed. May Cancel the callback immediately or at some point in the future if the rewrite should not be performed by the caller. Only one rewrite per callback.key() will be scheduled at once.
Implements net_instaweb::CentralController.
|
overridevirtual |
Implementations of this method should try to cancel any pending operations ASAP, and immediately reject new incoming ones. This method should behave safely when called more than once.
Implements net_instaweb::CentralController.