folly::coro::async_closure

Creates a lifetime-safe async closure task from bound args and a coroutine.

Synopsis

Declared in <folly/coro/safe/AsyncClosure.h>

template<async_closure_config Cfg = async_closure_config{}>
auto
async_closure(
    auto bargs,
    auto&& make_inner_coro);

Return Value

the outer coroutine task for the closure

Parameters

NameDescription
bargsthe bound arguments (typically bind::args{...})
make_inner_coroa callable that builds the inner coroutine