folly::fibers::async::executeWithNewRoot

Executes F with a new async-stack-root, making it possible to stitch stacks across async hops.

Synopsis

Declared in <folly/fibers/async/AsyncStack.h>

template<typename F>
Async<async_invocable_inner_type_t<F>>
executeWithNewRoot(
    F&& func,
    AsyncStackFrame* callerFrame);

Description

callerFrame, if not null, must outlive the execution of F.

Return Value

The async result of invoking func.

Parameters

NameDescription
funcFunction to execute under the new async-stack-root.
callerFrameFrame to stitch the new root onto, or null for none.