Fastly Compute C++ SDK
Loading...
Searching...
No Matches
fastly::http::request Namespace Reference

Classes

class  PendingRequest

Functions

std::pair< fastly::expected< fastly::http::Response >, std::vector< PendingRequest > > select (std::vector< PendingRequest > &reqs)

Function Documentation

◆ select()

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.

Examples
async_reqs.cpp.