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

#include <zmq_endpoint.h>

Inheritance diagram for Datacratic::ZmqMultipleNamedClientBusProxy:
Datacratic::MessageLoop Datacratic::Epoller Datacratic::AsyncEventSource

List of all members.

Classes

struct  OnConnectCallback

Public Types

typedef std::function< void(std::string)> ConnectionHandler
typedef std::function< void(std::string,
std::vector< std::string >)> 
MessageHandler

Public Member Functions

 ZmqMultipleNamedClientBusProxy (std::shared_ptr< zmq::context_t > context)
void init (std::shared_ptr< ConfigurationService > config, const std::string &identity="")
void shutdown ()
template<typename... Args>
void sendMessage (const std::string &recipient, const std::string &topic, Args &&...args) const
void connectAllServiceProviders (const std::string &serviceClass, const std::string &endpointName)
void connectSingleServiceProvider (const std::string &service)
void connectUri (const std::string &zmqUri)
size_t connectionCount () const
virtual void onConnect (const std::string &source)
virtual void onDisconnect (const std::string &source)
virtual void handleMessage (const std::string &source, const std::vector< std::string > &message)

Public Attributes

ConnectionHandler connectHandler
ConnectionHandler disconnectHandler
MessageHandler messageHandler

Detailed Description

Class designed to go on the other end of a zeromq named client bus. This takes care of sending the keepalives and will allow the other end to detect when the connection is broken.

Definition at line 1130 of file zmq_endpoint.h.


Member Typedef Documentation

typedef std::function<void (std::string)> Datacratic::ZmqMultipleNamedClientBusProxy::ConnectionHandler

Type of callback for a new connection.

Definition at line 1215 of file zmq_endpoint.h.

typedef std::function<void (std::string, std::vector<std::string>)> Datacratic::ZmqMultipleNamedClientBusProxy::MessageHandler

Type of handler to override what we do when we get a message.

Definition at line 1245 of file zmq_endpoint.h.


Member Function Documentation

void Datacratic::ZmqMultipleNamedClientBusProxy::connectAllServiceProviders ( const std::string &  serviceClass,
const std::string &  endpointName 
) [inline]

Connect to all instances of the given service type, and make sure that we listen and connect to any further ones that appear.

Definition at line 1181 of file zmq_endpoint.h.

Connect to a single named service.

void Datacratic::ZmqMultipleNamedClientBusProxy::connectUri ( const std::string &  zmqUri)

Connect directly to a zeromq uri.

virtual void Datacratic::ZmqMultipleNamedClientBusProxy::handleMessage ( const std::string &  source,
const std::vector< std::string > &  message 
) [inline, virtual]

Handle a message from a remote service. Source is the name of the service (this can be used to send something back). Message is the content of the message.

Definition at line 1256 of file zmq_endpoint.h.

virtual void Datacratic::ZmqMultipleNamedClientBusProxy::onConnect ( const std::string &  source) [inline, virtual]

Function that will be called when we make a new connection to a remote service provider.

Definition at line 1224 of file zmq_endpoint.h.

virtual void Datacratic::ZmqMultipleNamedClientBusProxy::onDisconnect ( const std::string &  source) [inline, virtual]

Function that will be called when we lose a connection to a remote service provider.

Definition at line 1237 of file zmq_endpoint.h.


Member Data Documentation

Callback that will be called when we get a new connection if onConnect() is not overridden.

Definition at line 1219 of file zmq_endpoint.h.

Callback that will be called when we get a disconnection if onDisconnect() is not overridden.

Definition at line 1232 of file zmq_endpoint.h.

Function to call when we get a message from a remote connection if handleMessage() is not overridden.

Definition at line 1250 of file zmq_endpoint.h.


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