22#include <boost/asio/spawn.hpp>
23#include <boost/asio/strand.hpp>
32concept IsStrand = std::same_as<std::decay_t<T>, boost::asio::strand<typename std::decay_t<T>::inner_executor_type>>;
49 std::rethrow_exception(ePtr);
51} kPROPAGATE_EXCEPTIONS;
66template <
typename Ctx,
typename F>
67 requires std::is_invocable_r_v<void, F, boost::asio::yield_context>
72 boost::asio::spawn(std::forward<Ctx>(ctx), std::forward<F>(func), impl::kPROPAGATE_EXCEPTIONS);
75 boost::asio::make_strand(std::forward<Ctx>(ctx).get_executor()),
76 std::forward<F>(func),
77 impl::kPROPAGATE_EXCEPTIONS
This namespace contains various utilities.
Definition AccountUtils.hpp:30
void spawn(Ctx &&ctx, F &&func)
Spawns a coroutine using boost::asio::spawn
Definition Spawn.hpp:69
A completion handler that restores boost::asio::spawn's behaviour from Boost 1.83.
Definition Spawn.hpp:40
void operator()(std::exception_ptr ePtr)
The completion handler.
Definition Spawn.hpp:46