ReCodEx - Task Broker
ReCodEx is complex programmer testing solution, primary targeted to technical universities. It's highly customizable and based on modern technologies.
broker_connect Class Reference

#include <broker_connect.h>

Public Member Functions

 broker_connect (std::shared_ptr< const broker_config > config, std::shared_ptr< zmq::context_t > context, std::shared_ptr< worker_registry > router, std::shared_ptr< spdlog::logger > logger=nullptr)
 
void start_brokering ()
 

Static Public Attributes

static const std::string KEY_WORKERS = "workers"
 
static const std::string KEY_CLIENTS = "clients"
 
static const std::string KEY_MONITOR = "monitor"
 
static const std::string KEY_STATUS_NOTIFIER = "status_notifier"
 
static const std::string KEY_TIMER = "timer"
 
static const std::string MONITOR_IDENTITY = "recodex-monitor"
 

Detailed Description

Receives requests from clients and forwards them to correct workers.

Definition at line 21 of file broker_connect.h.

Constructor & Destructor Documentation

§ broker_connect()

broker_connect::broker_connect ( std::shared_ptr< const broker_config config,
std::shared_ptr< zmq::context_t >  context,
std::shared_ptr< worker_registry router,
std::shared_ptr< spdlog::logger >  logger = nullptr 
)
Parameters
configa configuration object used to set up the connections
contextZeroMQ context
routerA registry used to track workers and their jobs
logger

Definition at line 13 of file broker_connect.cpp.

Member Function Documentation

§ start_brokering()

void broker_connect::start_brokering ( )

Bind to sockets and start receiving and routing requests. Blocks execution until the underlying ZeroMQ context is terminated.

Definition at line 43 of file broker_connect.cpp.

Member Data Documentation

§ KEY_CLIENTS

const std::string broker_connect::KEY_CLIENTS = "clients"
static

A string key for the socket connected to the clients

Definition at line 38 of file broker_connect.h.

§ KEY_MONITOR

const std::string broker_connect::KEY_MONITOR = "monitor"
static

A string key for the socket connected to the monitor

Definition at line 41 of file broker_connect.h.

§ KEY_STATUS_NOTIFIER

const std::string broker_connect::KEY_STATUS_NOTIFIER = "status_notifier"
static

A string key for messages for the status notifier

Definition at line 44 of file broker_connect.h.

§ KEY_TIMER

const std::string broker_connect::KEY_TIMER = "timer"
static

A string key for messages about time elapsed in the poll loop

Definition at line 47 of file broker_connect.h.

§ KEY_WORKERS

const std::string broker_connect::KEY_WORKERS = "workers"
static

A string key for the socket connected to the workers

Definition at line 35 of file broker_connect.h.

§ MONITOR_IDENTITY

const std::string broker_connect::MONITOR_IDENTITY = "recodex-monitor"
static

Identity of the monitor peer (necessary when working with router sockets)

Definition at line 50 of file broker_connect.h.


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