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);

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

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

Wrap a SemiAwaitable in a Task without starting it.

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

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);

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

Name

Description

a

The future to wrap.

Created with MrDocs