23 #include <boost/asio/io_service.hpp> 24 #include <boost/asio/steady_timer.hpp> 43 AsioModule(zmqpp::context &ctx, zmqpp::socket *pipe,
44 const boost::property_tree::ptree &cfg,
CoreUtilsPtr utils);
48 virtual void run()
override final;
57 template <
typename Callable>
58 void post(Callable &&callable)
75 std::unique_ptr<boost::asio::io_service::work>
work_;
87 struct StopWatcher :
public std::enable_shared_from_this<StopWatcher>
91 ,
timer_(self.io_service_){};
98 void wait(
const boost::system::error_code &ec);
105 :
public std::enable_shared_from_this<AsyncReactorPoller>
109 ,
timer_(self.io_service_){};
116 void wait_handler(
const boost::system::error_code &ec);
boost::asio::steady_timer timer_
AsyncReactorPoller(AsioModule &self)
boost::asio::steady_timer timer_
This is the header file for a generated source file, GitSHA1.cpp.
virtual void on_service_event(const service_event::Event &)=0
Function invoked when a service event is triggered.
boost::asio::io_service io_service_
bs2::connection service_event_listener_
StopWatcher(AsioModule &self)
void post(Callable &&callable)
Post some work onto the work queue of the module.
void install_async_handlers()
Install handlers that periodically poll for activity on the ZMQ reactor from BaseModule.
Base class for module implementation.
Poll the zmq reactor from BaseModule.
AsioModule(zmqpp::context &ctx, zmqpp::socket *pipe, const boost::property_tree::ptree &cfg, CoreUtilsPtr utils)
std::unique_ptr< boost::asio::io_service::work > work_
This is a base class for boost::asio 'aware' module.
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)