collectAny overloads
Synopses
Declared in <folly/fibers/WhenN.h>
Schedules several tasks and blocks until one of them is completed. If this task throws an exception, this exception will be re‐thrown. Exceptions thrown by all other tasks will be ignored.
template<class InputIterator>
std::pair<size_t, std::invoke_result_t<std::iterator_traits<InputIterator>::value_type>>
collectAny(
InputIterator first,
InputIterator last)
requires !std::is_same<
std::invoke_result_t<
typename std::iterator_traits<InputIterator>::value_type>,
void>::value;
WhenAny specialization for functions returning void.
template<class InputIterator>
size_t
collectAny(
InputIterator first,
InputIterator last)
requires std::is_same<
std::invoke_result_t<
typename std::iterator_traits<InputIterator>::value_type>,
void>::value;
Return Value
-
pair of index of the first completed task and its return value
-
index of the first completed task
Parameters
Name |
Description |
first |
Range of tasks to be scheduled |
last |
End of the range of tasks to be scheduled |
Created with MrDocs