folly::coro::toFuture

Converts the given SemiAwaitable to a Future, starting it on the Executor.

Synopsis

Declared in <folly/coro/FutureUtil.h>

template<typename SemiAwaitable>
folly::Future<lift_unit_t<semi_await_result_t<remove_reference_wrapper_t<SemiAwaitable>>>>
toFuture(
    SemiAwaitable&& a,
    Executor::KeepAlive<> ex);

Return Value

A Future for the result of the awaitable.

Parameters

NameDescription
aThe SemiAwaitable to convert and start.
exThe executor on which to start and resume the work.