RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions | Public Attributes
Datacratic::ZmqBinaryEventSource Struct Reference

#include <zmq_endpoint.h>

Inheritance diagram for Datacratic::ZmqBinaryEventSource:
Datacratic::AsyncEventSource

List of all members.

Public Types

typedef std::function< void(std::vector
< zmq::message_t > &&)> 
MessageHandler

Public Member Functions

 ZmqBinaryEventSource (zmq::socket_t &socket, MessageHandler messageHandler=MessageHandler())
void init (zmq::socket_t &socket)
virtual int selectFd () const
virtual bool poll () const
virtual bool processOne ()
virtual void handleMessage (std::vector< zmq::message_t > &&message)
zmq::socket_tsocket () const

Public Attributes

MessageHandler messageHandler
zmq::socket_tsocket_

Detailed Description

Adaptor that allows any zeromq socket to hook into an event loop.

Definition at line 122 of file zmq_endpoint.h.


Member Function Documentation

virtual void Datacratic::ZmqBinaryEventSource::handleMessage ( std::vector< zmq::message_t > &&  message) [inline, virtual]

Handle a message. The default implementation will call syncMessageHandler if it is defined; otherwise it calls handleSyncMessage and writes back the response to the socket.

Definition at line 189 of file zmq_endpoint.h.

virtual bool Datacratic::ZmqBinaryEventSource::poll ( ) const [inline, virtual]

Returns true if there is work to be done. May be called from more than one thread. Should never block.

Reimplemented from Datacratic::AsyncEventSource.

Definition at line 158 of file zmq_endpoint.h.

virtual bool Datacratic::ZmqBinaryEventSource::processOne ( ) [inline, virtual]

Process a single message and return true if there are more to be processed.

This may be called from more than one thread if singleThreaded() is false.

Implements Datacratic::AsyncEventSource.

Definition at line 163 of file zmq_endpoint.h.

virtual int Datacratic::ZmqBinaryEventSource::selectFd ( ) const [inline, virtual]

Return the file descriptor on which one should select() for messages from this source. The source should organize itself such that if the fd indicates ready for a read, there is something to do.

Should return -1 if it requires polling.

Should never block.

Reimplemented from Datacratic::AsyncEventSource.

Definition at line 148 of file zmq_endpoint.h.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator