Skip to main content

fetch_many

Function fetch_many 

Source
pub fn fetch_many(
    requests: &[FetchRequest<'_>],
) -> Vec<Result<FetchResponse, String>>
Expand description

Make N HTTP requests concurrently from the host. Per-item errors are reported in the returned slot (other slots still succeed). Use this when you’d otherwise call fetch in a loop — sequential blocking fetches inside WASM are linear, the host fan-out is parallel.

The host bounds concurrency (default 32) so an unbounded list won’t exhaust connections.

let results = http::fetch_many(&[
    http::FetchRequest { method: "GET", url: "https://a", headers: &[], body: None },
    http::FetchRequest { method: "GET", url: "https://b", headers: &[], body: None },
]);