![]() |
RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
Public Member Functions | |
| ServiceBase (const std::string &serviceName, std::shared_ptr< ServiceProxies >=std::shared_ptr< ServiceProxies >()) | |
| ServiceBase (const std::string &subServiceName, ServiceBase &parent) | |
| void | setServices (std::shared_ptr< ServiceProxies > services) |
| std::shared_ptr< ServiceProxies > | getServices () const |
| std::string | serviceName () const |
| void | registerServiceProvider (const std::string &name, const std::vector< std::string > &serviceClasses) |
| void | unregisterServiceProvider (const std::string &name, const std::vector< std::string > &serviceClasses) |
| std::shared_ptr< zmq::context_t > | getZmqContext () const |
| void | logException (std::exception_ptr exc, const std::string &context) |
| virtual Json::Value | getServiceStatus () const |
| virtual void | addChildServiceStatus (Json::Value &result) const |
Protected Attributes | |
| std::shared_ptr< ServiceProxies > | services_ |
| std::string | serviceName_ |
| ServiceBase * | parent_ |
| std::vector< ServiceBase * > | children_ |
Definition at line 546 of file service_base.h.
| Datacratic::ServiceBase::ServiceBase | ( | const std::string & | serviceName, |
| std::shared_ptr< ServiceProxies > | services = std::shared_ptr<ServiceProxies>() |
||
| ) |
Construct as a top level parent.
Definition at line 596 of file service_base.cc.
| Datacratic::ServiceBase::ServiceBase | ( | const std::string & | subServiceName, |
| ServiceBase & | parent | ||
| ) |
Construct as a child of an existing parent.
Definition at line 609 of file service_base.cc.
| void Datacratic::ServiceBase::addChildServiceStatus | ( | Json::Value & | result | ) | const [virtual] |
Function that iterates over all children and adds their service status to the given JSON object with keys as their names.
Mutates the result argument in-place.
Definition at line 665 of file service_base.cc.
| Json::Value Datacratic::ServiceBase::getServiceStatus | ( | ) | const [virtual] |
Function to be called by something that wants to know the current status of this service. Returns a JSON object that could be inspected by a human or consumed by a service.
Reimplemented in RTBKIT::Router, RTBKIT::PostAuctionLoop, and RTBKIT::HttpExchangeConnector.
Definition at line 654 of file service_base.cc.
| void Datacratic::ServiceBase::registerServiceProvider | ( | const std::string & | name, |
| const std::vector< std::string > & | serviceClasses | ||
| ) |
Register this as a service, that provides the given service classes.
This will create sufficient entries in the configuration that something needing to find providers of any of the given services will be able to find this service.
Definition at line 631 of file service_base.cc.
| void Datacratic::ServiceBase::unregisterServiceProvider | ( | const std::string & | name, |
| const std::vector< std::string > & | serviceClasses | ||
| ) |
Unregister service from configuration service.
Definition at line 644 of file service_base.cc.
1.7.6.1