29 const boost::property_tree::ptree &cfg,
CoreUtilsPtr utils)
52 auto stop_watcher(std::make_shared<StopWatcher>(*
this));
53 stop_watcher->schedule_wait();
55 auto reactor_poller(std::make_shared<AsyncReactorPoller>(*
this));
56 reactor_poller->schedule_wait();
63 WARN(
"AsioModule StopWatcher timer has errored: " << ec.message());
66 if (!self_.is_running_)
74 timer_.expires_from_now(std::chrono::milliseconds(1000));
76 std::placeholders::_1));
81 timer_.expires_from_now(std::chrono::milliseconds(25));
83 shared_from_this(), std::placeholders::_1));
87 const boost::system::error_code &ec)
89 ASSERT_LOG(ec == 0,
"Error while processing wait_handler: " << ec.message());
90 self_.reactor_.poll(0);
91 if (self_.is_running_)
This is the header file for a generated source file, GitSHA1.cpp.
void wait_handler(const boost::system::error_code &ec)
virtual void on_service_event(const service_event::Event &)=0
Function invoked when a service event is triggered.
boost::asio::io_service io_service_
ServiceRegistry & get_service_registry()
A function to retrieve the ServiceRegistry from pretty much anywhere.
bs2::connection service_event_listener_
void install_async_handlers()
Install handlers that periodically poll for activity on the ZMQ reactor from BaseModule.
Base class for module implementation.
#define ASSERT_LOG(cond, msg)
AsioModule(zmqpp::context &ctx, zmqpp::socket *pipe, const boost::property_tree::ptree &cfg, CoreUtilsPtr utils)
bs2::connection register_event_listener(T &&callable)
Register a service-event listener.
std::unique_ptr< boost::asio::io_service::work > work_
virtual void run() override final
This is the main loop of the module.
std::shared_ptr< CoreUtils > CoreUtilsPtr
void wait(const boost::system::error_code &ec)