8 #ifndef DRIPLINE_HUB_HH_ 9 #define DRIPLINE_HUB_HH_ 15 #include <unordered_map> 73 typedef std::function< reply_ptr_t( const dripline::request_ptr_t ) >
handler_func_t;
76 hub(
const scarab::param_node& a_config = scarab::param_node(),
const std::string& a_queue_name =
"",
const std::string& a_broker_address =
"",
unsigned a_port = 0,
const std::string& a_auth_file =
"" ,
const bool a_make_connection =
true );
80 void set_run_handler(
const handler_func_t& a_func );
82 void register_get_handler(
const std::string& a_key,
const handler_func_t& a_func );
84 void register_set_handler(
const std::string& a_key,
const handler_func_t& a_func );
86 void register_cmd_handler(
const std::string& a_key,
const handler_func_t& a_func );
89 void remove_get_handler(
const std::string& a_key );
91 void remove_set_handler(
const std::string& a_key );
93 void remove_cmd_handler(
const std::string& a_key );
handler_funcs_t f_get_handlers
std::function< reply_ptr_t(const dripline::request_ptr_t) > handler_func_t
std::unordered_map< std::string, handler_func_t > handler_funcs_t
std::shared_ptr< msg_request > request_ptr_t
Consumer of Dripline messages on a particular queue.
Service class aimed at adding a Dripline API to an existing codebase.
handler_func_t f_run_handler
handler_funcs_t f_set_handlers
std::shared_ptr< msg_reply > reply_ptr_t
handler_funcs_t f_cmd_handlers