ReCodEx - Task Broker
ReCodEx is complex programmer testing solution, primary targeted to technical universities. It's highly customizable and based on modern technologies.
worker_registry.h
1 #ifndef RECODEX_BROKER_ROUTER_H
2 #define RECODEX_BROKER_ROUTER_H
3 
4 #include <map>
5 #include <memory>
6 #include <queue>
7 #include <vector>
8 
9 #include "worker.h"
10 
15 {
16 public:
18  typedef std::shared_ptr<worker> worker_ptr;
19 
20 private:
22  std::vector<worker_ptr> workers_;
23 
24 public:
31  virtual void add_worker(worker_ptr worker);
36  virtual void remove_worker(worker_ptr worker);
42  virtual worker_ptr find_worker(const request::headers_t &headers);
48  virtual worker_ptr find_worker_by_identity(const std::string &identity);
55  virtual void deprioritize_worker(worker_ptr worker);
60  virtual const std::vector<worker_ptr> &get_workers() const;
61 };
62 
63 #endif // RECODEX_BROKER_ROUTER_H
virtual worker_ptr find_worker_by_identity(const std::string &identity)
virtual void add_worker(worker_ptr worker)
virtual void deprioritize_worker(worker_ptr worker)
virtual worker_ptr find_worker(const request::headers_t &headers)
std::shared_ptr< worker > worker_ptr
std::multimap< std::string, std::string > headers_t
Definition: worker.h:80
Definition: worker.h:147
virtual const std::vector< worker_ptr > & get_workers() const
virtual void remove_worker(worker_ptr worker)