#ifndef ADAPTERS_BOOST_ASIO_DEADLINE_TIMER_AREQ_H #define ADAPTERS_BOOST_ASIO_DEADLINE_TIMER_AREQ_H #include #include #include #include #include namespace adapters::boostAsio { using TimerWaitCbFn = std::function; inline auto deadlineTimerWaitAReq( boost::asio::io_service &ioService, const boost::posix_time::milliseconds delay) { return smo::cpsBoundary::CpsCallbackAReq)>>( ioService, [&ioService, delay](sscl::cps::Callback cb) { auto timer = std::make_shared(ioService); timer->expires_from_now(delay); timer->async_wait( [timer, cb](const boost::system::error_code &error) mutable { cb.callbackFn(!error); }); }); } } // namespace adapters::boostAsio #endif // ADAPTERS_BOOST_ASIO_DEADLINE_TIMER_AREQ_H