rippled
Loading...
Searching...
No Matches
Namespaces | Functions
ripple::util Namespace Reference

Namespaces

namespace  impl
 

Functions

template<typename Ctx , typename F >
requires std::is_invocable_r_v<void, F, boost::asio::yield_context>
void spawn (Ctx &&ctx, F &&func)
 Spawns a coroutine using boost::asio::spawn
 

Function Documentation

◆ spawn()

template<typename Ctx , typename F >
requires std::is_invocable_r_v<void, F, boost::asio::yield_context>
void ripple::util::spawn ( Ctx &&  ctx,
F &&  func 
)

Spawns a coroutine using boost::asio::spawn

Note
This uses kPROPAGATE_EXCEPTIONS to force asio to propagate exceptions through io_context
Since implicit strand was removed from boost::asio::spawn this helper function adds the strand back
Template Parameters
CtxThe type of the context/strand
FThe type of the function to execute
Parameters
ctxThe execution context
funcThe function to execute. Must return void

Definition at line 87 of file Spawn.h.