![]() |
RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
#include <zmq_named_pub_sub.h>
Public Types | |
typedef std::function< void(std::vector < zmq::message_t > &&)> | MessageHandler |
typedef std::mutex | Lock |
typedef std::map< std::string, std::unique_ptr < ZmqNamedSubscriber > > | SubscriberMap |
Public Member Functions | |
ZmqNamedMultipleSubscriber (std::shared_ptr< zmq::context_t > context) | |
void | init (std::shared_ptr< ConfigurationService > config) |
void | shutdown () |
void | connectAllServiceProviders (const std::string &serviceClass, const std::string &endpointName, const std::vector< std::string > &prefixes=std::vector< std::string >()) |
virtual void | handleMessage (std::vector< zmq::message_t > &&message) |
void | connectService (std::string serviceClass, std::string service, std::string endpointName) |
void | disconnectService (std::string serviceClass, std::string service, std::string endpointName) |
Public Attributes | |
MessageHandler | messageHandler |
ServiceProviderWatcher | serviceWatcher |
std::shared_ptr< zmq::context_t > | context |
Lock | lock |
SubscriberMap | subscribers |
std::shared_ptr < ConfigurationService > | config |
std::vector< std::string > | prefixes |
Counterpart to the ZmqNamedPublisher. It subscribes to all publishers of a given class.
Definition at line 975 of file zmq_named_pub_sub.h.
typedef std::function<void (std::vector<zmq::message_t> &&)> Datacratic::ZmqNamedMultipleSubscriber::MessageHandler |
Callback that will be called when a message is received if handlerMessage is not overridden.
Definition at line 1032 of file zmq_named_pub_sub.h.
typedef std::map<std::string, std::unique_ptr<ZmqNamedSubscriber> > Datacratic::ZmqNamedMultipleSubscriber::SubscriberMap |
Map of service name to subscribers
Definition at line 1131 of file zmq_named_pub_sub.h.
void Datacratic::ZmqNamedMultipleSubscriber::connectService | ( | std::string | serviceClass, |
std::string | service, | ||
std::string | endpointName | ||
) | [inline] |
Connect to the given service.
Definition at line 1048 of file zmq_named_pub_sub.h.
void Datacratic::ZmqNamedMultipleSubscriber::disconnectService | ( | std::string | serviceClass, |
std::string | service, | ||
std::string | endpointName | ||
) | [inline] |
Disconnect from the given service.
Definition at line 1105 of file zmq_named_pub_sub.h.
virtual void Datacratic::ZmqNamedMultipleSubscriber::handleMessage | ( | std::vector< zmq::message_t > && | message | ) | [inline, virtual] |
Function called when a message is received on the socket. Default action is to call messageHandler. Can be overridden or messageHandler can be assigned to.
Definition at line 1039 of file zmq_named_pub_sub.h.
This is responsible for watching the service providers and connecting to new ones when they pop up.
Definition at line 1123 of file zmq_named_pub_sub.h.