hpx::wait_all_for_n#
Defined in header hpx/future.hpp.
See Public API for a list of names and headers that are part of the public HPX API.
See also:
-
template<typename InputIter>
hpx::future_status hpx::wait_all_for_n(hpx::chrono::steady_duration const &timeout, InputIter begin, std::size_t count)# The function wait_all_for_n is an operator allowing to join on the result of all given futures, similar to wait_all_n. It differs from wait_all_n in that it will not suspend indefinitely if one or more of the given futures never become ready; instead it returns as soon as either all futures have become ready, or the given timeout has elapsed, whichever happens first.
Note
The function wait_all_for_n returns after all futures have become ready, or after the given timeout has expired, whichever comes first. All input futures are still valid after wait_all_for_n returns, independently of the returned status, and can be inspected (e.g. using is_ready()) to determine which of the given futures have become ready.
Note
The function wait_all_for_n will rethrow any exceptions captured by the futures while becoming ready, as long as all the given futures became ready before the timeout elapsed. If this behavior is undesirable, use wait_all_for_n_nothrow instead.
- Parameters:
timeout – The maximum duration to wait for all the given futures to become ready.
begin – The iterator pointing to the first element of a sequence of future or shared_future objects for which wait_all_for_n should wait.
count – The number of elements in the sequence starting at first.
- Returns:
Returns hpx::future_status::ready if all the given futures have become ready before timeout has elapsed, and hpx::future_status::timeout otherwise.