select

Functionin requestcompute-sdk-cpp 0.7.0View source
std::pair<fastly::expected<Response>, std::vector<PendingRequest>> fastly::http::request::select(std::vector<PendingRequest> &reqs)

Given a collection of PendingRequests, block until the result of one of the requests is ready.

Returns an std::pair of <result, remaining>, where:

  • result is the result of the request that became ready.
  • remaining is a vector containing all of the requests that did not become ready. The order of the requests in this vector is not guaranteed to match the order of the requests in the argument collection.
Panics

Panics if the argument collection is empty, or contains too many requests.

Parameters

reqs: std::vector &<PendingRequest>

Returns

std::pair<fastly::expected<fastly::http::Response>, std::vector<PendingRequest>>