RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
#include <zmq_endpoint.h>
Public Types | |
typedef std::function< void(std::string, int, zmq_event_t)> | EventHandler |
Public Member Functions | |
ZmqSocketMonitor (zmq::context_t &context) | |
void | shutdown () |
void | init (zmq::socket_t &socketToMonitor, int events=ZMQ_EVENT_ALL) |
virtual int | handleEvent (const zmq_event_t &event) |
Public Attributes | |
EventHandler | connectHandler |
EventHandler | bindHandler |
EventHandler | acceptHandler |
EventHandler | closeHandler |
EventHandler | disconnectHandler |
EventHandler | connectFailureHandler |
EventHandler | acceptFailureHandler |
EventHandler | bindFailureHandler |
EventHandler | closeFailureHandler |
EventHandler | connectRetryHandler |
EventHandler | defaultHandler |
This class allows a zeromq socket to be monitored and events received on various events.
It is an AsyncEventHandler which must be integrated into a message queue. The events will be delivered when processed by the message queue.
Definition at line 380 of file zmq_endpoint.h.
typedef std::function<void (std::string, int, zmq_event_t)> Datacratic::ZmqSocketMonitor::EventHandler |
Event handler for events:
Definition at line 410 of file zmq_endpoint.h.
int Datacratic::ZmqSocketMonitor::handleEvent | ( | const zmq_event_t & | event | ) | [virtual] |
Function called to handle an event. Default implementation looks at the event type and dispatches to one of the xxxHandler variables above, or defaultHandler if it's empty.
This can be overriden to modify the behaviour.
Definition at line 203 of file zmq_endpoint.cc.
void Datacratic::ZmqSocketMonitor::init | ( | zmq::socket_t & | socketToMonitor, |
int | events = ZMQ_EVENT_ALL |
||
) |
Initialize the socket monitor to monitor the given socket.
The events parameter is an event mask; see http://api.zeromq.org/3-2:zmq-socket-monitor for details of what it means.
Definition at line 170 of file zmq_endpoint.cc.