folly::coro::toTask

toTask overloads

Synopses

Declared in <folly/coro/FutureUtil.h>

Wrap a Future<Unit> in a Task without starting it.

Task<void>
toTask(folly::Future<Unit> a);
» more...

Wrap a SemiFuture<Unit> in a Task without starting it.

Task<void>
toTask(folly::SemiFuture<Unit> a);
» more...

Wrap a SemiAwaitable in a Task without starting it.

template<typename SemiAwaitable>
Task<semi_await_result_t<SemiAwaitable>>
toTask(SemiAwaitable a);
» more...

Wrap a referenced SemiAwaitable in a Task without starting it.

template<typename SemiAwaitable>
Task<semi_await_result_t<SemiAwaitable>>
toTask(std::reference_wrapper<SemiAwaitable> a);
» more...

Return Value

  • A Task that awaits the future when started.
  • A Task that awaits the semi-future when started.
  • A Task that awaits a when started.
  • A Task that awaits the referenced awaitable when started.

Parameters

NameDescription
aThe future to wrap.