Leosac  0.8.0
Open Source Access Control
MessageBus Class Reference

Implements a message bus (running in its own thread) that use 2 sockets. More...

#include <MessageBus.hpp>

Public Member Functions

 MessageBus (zmqpp::context &ctx)
 
 ~MessageBus ()
 

Private Member Functions

bool run (zmqpp::socket *pipe)
 The method that will be run in the child thread. More...
 
void handle_pipe (zmqpp::socket *pipe)
 
void handle_pull ()
 

Private Attributes

zmqpp::actor * actor_
 
zmqpp::context & ctx_
 
zmqpp::socket * pub_
 
zmqpp::socket * pull_
 
bool running_
 

Detailed Description

Implements a message bus (running in its own thread) that use 2 sockets.

PULL socket to receive message from client (available at inproc://zmq-bus-pull) PUB socket to publish everything it received (available at inproc://zmq-bus-pub)

Definition at line 29 of file MessageBus.hpp.

Constructor & Destructor Documentation

◆ MessageBus()

MessageBus::MessageBus ( zmqpp::context &  ctx)

Definition at line 23 of file MessageBus.cpp.

◆ ~MessageBus()

MessageBus::~MessageBus ( )

Definition at line 33 of file MessageBus.cpp.

Member Function Documentation

◆ handle_pipe()

void MessageBus::handle_pipe ( zmqpp::socket *  pipe)
private

Definition at line 70 of file MessageBus.cpp.

◆ handle_pull()

void MessageBus::handle_pull ( )
private

Definition at line 81 of file MessageBus.cpp.

◆ run()

bool MessageBus::run ( zmqpp::socket *  pipe)
private

The method that will be run in the child thread.

Pipe is a PAIR socket back to ZmqBus object.

Definition at line 38 of file MessageBus.cpp.

Member Data Documentation

◆ actor_

zmqpp::actor* MessageBus::actor_
private

Definition at line 36 of file MessageBus.hpp.

◆ ctx_

zmqpp::context& MessageBus::ctx_
private

Definition at line 44 of file MessageBus.hpp.

◆ pub_

zmqpp::socket* MessageBus::pub_
private

Definition at line 46 of file MessageBus.hpp.

◆ pull_

zmqpp::socket* MessageBus::pull_
private

Definition at line 47 of file MessageBus.hpp.

◆ running_

bool MessageBus::running_
private

Definition at line 53 of file MessageBus.hpp.


The documentation for this class was generated from the following files: