MCPcopy Create free account
hub / github.com/boostorg/asio / throw_in_first_suspend

Function throw_in_first_suspend

test/co_composed.cpp:93–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91
92template <typename CompletionToken>
93auto throw_in_first_suspend(CompletionToken&& token)
94{
95 return boost::asio::async_initiate<CompletionToken, void()>(
96 boost::asio::co_composed(
97 [](auto state) -> void
98 {
99 co_await async_throw(boost::asio::deferred);
100 co_yield state.complete();
101 }), token);
102}
103
104void test_throw_in_first_suspend()
105{

Callers 1

Calls 2

async_throwFunction · 0.85
completeMethod · 0.45

Tested by 1