hpx/resiliency/async_replicate.hpp#

Defined in header hpx/resiliency/async_replicate.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
namespace resiliency
namespace experimental

Functions

template<typename Vote, typename Pred, typename F, typename ...Ts>
hpx::future<hpx::util::detail::invoke_deferred_result_t<F, Ts...>> hpx_invoke(async_replicate_vote_validate_t, std::size_t n, Vote &&vote, Pred &&pred, F &&f, Ts&&... ts)#

ADL hook for async_replicate_vote_validate CPO.

Asynchronously launches f exactly n times, validates results with pred, then runs valid results through vote.

Parameters
  • tag – CPO tag (async_replicate_vote_validate_t).

  • n – Number of replicated invocations.

  • vote – Voting function selecting among valid results.

  • pred – Predicate validating each invocation result.

  • f – Callable to invoke asynchronously.

  • ts – Arguments forwarded to f.

Returns

future with the voted-upon result.

template<typename Vote, typename F, typename ...Ts>
hpx::future<hpx::util::detail::invoke_deferred_result_t<F, Ts...>> hpx_invoke(async_replicate_vote_t, std::size_t n, Vote &&vote, F &&f, Ts&&... ts)#

ADL hook for async_replicate_vote CPO.

Asynchronously launches f exactly n times, runs valid results through vote. Validation uses the default exception check.

Parameters
  • tag – CPO tag (async_replicate_vote_t).

  • n – Number of replicated invocations.

  • vote – Voting function selecting among valid results.

  • f – Callable to invoke asynchronously.

  • ts – Arguments forwarded to f.

Returns

future with the voted-upon result.

template<typename Pred, typename F, typename ...Ts>
hpx::future<hpx::util::detail::invoke_deferred_result_t<F, Ts...>> hpx_invoke(async_replicate_validate_t, std::size_t n, Pred &&pred, F &&f, Ts&&... ts)#

ADL hook for async_replicate_validate CPO.

Asynchronously launches f exactly n times, validates results with pred. Returns the first valid result.

Parameters
  • tag – CPO tag (async_replicate_validate_t).

  • n – Number of replicated invocations.

  • pred – Predicate validating each invocation result.

  • f – Callable to invoke asynchronously.

  • ts – Arguments forwarded to f.

Returns

future with the first valid result.

template<typename F, typename ...Ts>
hpx::future<hpx::util::detail::invoke_deferred_result_t<F, Ts...>> hpx_invoke(async_replicate_t, std::size_t n, F &&f, Ts&&... ts)#

ADL hook for async_replicate CPO.

Asynchronously launches f exactly n times. Validates by checking for exceptions. Returns the first valid result.

Parameters
  • tag – CPO tag (async_replicate_t).

  • n – Number of replicated invocations.

  • f – Callable to invoke asynchronously.

  • ts – Arguments forwarded to f.

Returns

future with the first non-throwing result.