#pragma once #include "types/duration_types.hpp" #include #include #include namespace utils { template void makeDetachedTimer(boost::asio::io_context& ioc, Milliseconds delay, F&& fun) { auto timer = std::make_unique(ioc); timer->expires_after(delay); timer->async_wait([timer = std::move(timer), fun = std::move(fun)](boost::system::error_code ec) { if (ec) { return; } fun(); }); } } // namespace utils