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.h
1 #ifndef RECODEX_BROKER_BROKER_HPP
2 #define RECODEX_BROKER_BROKER_HPP
3 
4 
5 #include "config/broker_config.h"
6 #include "handlers/broker_handler.h"
7 #include "handlers/status_notifier_handler.h"
8 #include "helpers/logger.h"
9 #include "notifier/empty_status_notifier.h"
10 #include "notifier/status_notifier.h"
11 #include "reactor/command_holder.h"
12 #include "reactor/reactor.h"
13 #include "reactor/router_socket_wrapper.h"
14 #include "worker_registry.h"
15 #include <chrono>
16 #include <memory>
17 
22 {
23 private:
25  std::shared_ptr<const broker_config> config_;
27  std::shared_ptr<spdlog::logger> logger_;
29  std::shared_ptr<worker_registry> workers_;
31  reactor reactor_;
32 
33 public:
35  const static std::string KEY_WORKERS;
36 
38  const static std::string KEY_CLIENTS;
39 
41  const static std::string KEY_MONITOR;
42 
44  const static std::string KEY_STATUS_NOTIFIER;
45 
47  const static std::string KEY_TIMER;
48 
50  const static std::string MONITOR_IDENTITY;
51 
58  broker_connect(std::shared_ptr<const broker_config> config,
59  std::shared_ptr<zmq::context_t> context,
60  std::shared_ptr<worker_registry> router,
61  std::shared_ptr<spdlog::logger> logger = nullptr);
62 
67  void start_brokering();
68 };
69 
70 
71 #endif // RECODEX_BROKER_BROKER_HPP
static const std::string KEY_STATUS_NOTIFIER
static const std::string MONITOR_IDENTITY
static const std::string KEY_WORKERS
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)
static const std::string KEY_CLIENTS
static const std::string KEY_MONITOR
static const std::string KEY_TIMER