folly::coro::collectAllWindowed

collectAllWindowed overloads

Synopses

Declared in <folly/coro/Collect.h>

Await a range of value-less awaitables with bounded concurrency.

template<typename InputRange>
requires std::is_void_v<
            semi_await_result_t<detail::range_reference_t<InputRange>>>
folly::coro::Task<void>
collectAllWindowed(
    InputRange awaitables,
    std::size_t maxConcurrency);
» more...

Await a range of awaitables with bounded concurrency, collecting results.

template<typename InputRange>
requires !std::is_void_v<
            semi_await_result_t<detail::range_reference_t<InputRange>>>
folly::coro::Task<std::vector</* implementation-defined */>>
collectAllWindowed(
    InputRange awaitables,
    std::size_t maxConcurrency);
» more...

Await an rvalue vector of awaitables with bounded concurrency.

template<typename SemiAwaitable>
decltype(collectAllWindowed(
        detail::MoveRange(awaitables), maxConcurrency))
collectAllWindowed(
    std::vector<SemiAwaitable> awaitables,
    std::size_t maxConcurrency);
» more...

Return Value

  • A Task that completes when every awaitable has finished.
  • A Task completing with a vector of the results in input order.

Parameters

NameDescription
awaitablesThe range of awaitables to await.
maxConcurrencyThe maximum number of awaitables awaited at once.