20 #ifndef BITZ_MANAGER_H 21 #define BITZ_MANAGER_H 24 #include <spdlog/spdlog.h> 25 #include <psocksxx/tcpnsockstream.h> 27 #include "manager_exception.h" 30 #ifndef BITZ_MAX_WORKERS 31 #define BITZ_MAX_WORKERS 2 34 #ifndef BITZ_MAX_WORKER_REQUESTS 35 #define BITZ_MAX_WORKER_REQUESTS 100 46 unsigned int worker_id;
52 unsigned int max_workers;
53 unsigned int max_worker_requests;
54 unsigned int comm_timeout;
55 unsigned int workers_count;
56 unsigned int worker_id;
58 psocksxx::tcpnsockstream * socket;
66 Manager(
unsigned short port,
const std::string &address =
"0.0.0.0",
int backlog = 128 )
throw(
ManagerException );
73 virtual void spawn(
unsigned int max_workers = BITZ_MAX_WORKERS,
74 unsigned int max_worker_requests = BITZ_MAX_WORKER_REQUESTS,
77 virtual void shutdown(
bool graceful =
true )
throw();
78 virtual void reap_worker( pid_t worker_pid )
throw();
79 virtual void manage_workers()
throw();
84 std::shared_ptr<spdlog::logger> _logger;
86 virtual void spawn_worker(
unsigned int worker_id )
throw(
ManagerException );
virtual ~Manager()
Definition: manager.cpp:64
Definition: manager_exception.h:27
Manager(unsigned short port, const std::string &address="0.0.0.0", int backlog=128)
Definition: manager.cpp:30