folly::futures::retrying

Retries a future-factory according to a policy, returning a SemiFuture.

Synopsis

Declared in <folly/futures/Retrying.h>

template<
    class Policy,
    class FF>
[[nodiscard]]
SemiFuture<isFutureOrSemiFuture<std::invoke_result_t<FF, size_t>>::Inner>
retrying(
    Policy&& p,
    FF&& ff);

Return Value

A SemiFuture with the result of the first successful attempt.

NOTE

The return value should not be discarded.

Parameters

NameDescription
pThe retry policy deciding whether another attempt is made.
ffThe future-factory invoked to produce each attempt.