folly::coro::timed_wait

Awaits awaitable, giving up after duration elapses.

Synopsis

Declared in <folly/coro/TimedWait.h>

template<typename Awaitable>
Task<Optional<lift_unit_t</* implementation-defined */>>>
timed_wait(
    Awaitable awaitable,
    Duration duration);

Return Value

A task with the awaitable's result, or folly::none on timeout.

Parameters

NameDescription
awaitableThe operation to await.
durationThe maximum time to wait before timing out.