RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
Public Types | |
typedef std::unique_lock < std::mutex > | Guard |
Public Member Functions | |
MonitorClient (const std::shared_ptr< zmq::context_t > &context, int checkTimeout=2) | |
void | init (std::shared_ptr< ConfigurationService > &config, const std::string &serviceName="monitor") |
void | shutdown () |
bool | getStatus () const |
void | checkStatus () |
void | onResponseReceived (std::exception_ptr ext, int responseCode, const std::string &body) |
Public Attributes | |
RestProxy::OnDone | onDone |
bool | pendingRequest |
std::mutex | requestLock |
int | checkTimeout_ |
bool | lastStatus |
Date | lastCheck |
bool | testMode |
bool | testResponse |
Definition at line 19 of file monitor_client.h.
typedef std::unique_lock<std::mutex> RTBKIT::MonitorClient::Guard |
the mutex used when pendingRequest is tested and modified
Reimplemented from Datacratic::MessageLoop.
Definition at line 61 of file monitor_client.h.
void RTBKIT::MonitorClient::checkStatus | ( | ) |
method invoked periodically to trigger a request to the Monitor
Definition at line 41 of file monitor_client.cc.
bool RTBKIT::MonitorClient::getStatus | ( | ) | const |
this method tests whether the last status obtained by the Monitor is positive and fresh enough to continue operations
Definition at line 81 of file monitor_client.cc.
void RTBKIT::MonitorClient::onResponseReceived | ( | std::exception_ptr | ext, |
int | responseCode, | ||
const std::string & | body | ||
) |
method executed when we receive the response from the Monitor
Definition at line 58 of file monitor_client.cc.
void RTBKIT::MonitorClient::shutdown | ( | ) |
shutdown the MessageLoop but make sure all requests have been completed beforehand.
Reimplemented from Datacratic::RestProxy.
Definition at line 33 of file monitor_client.cc.
the timeout that determines whether the last check is too old
Definition at line 65 of file monitor_client.h.
the timestamp when "lastStatus" was last updated
Definition at line 71 of file monitor_client.h.
the status returned by the Monitor
Definition at line 68 of file monitor_client.h.
RestProxy::OnDone RTBKIT::MonitorClient::onDone |
bound instance of onResponseReceived
Definition at line 55 of file monitor_client.h.
whether a request roundtrip to the Monitor is currently active
Definition at line 58 of file monitor_client.h.
helper members to make testing of dependent services easier
Definition at line 74 of file monitor_client.h.