pub async fn coalesce_ranges<F, E, Fut>(
ranges: &[Range<usize>],
fetch: F,
coalesce: usize,
) -> Result<Vec<Bytes>, E>
Expand description
Takes a function fetch
that can fetch a range of bytes and uses this to
fetch the provided byte ranges
To improve performance it will:
- Combine ranges less than
coalesce
bytes apart into a single call tofetch
- Make multiple
fetch
requests in parallel (up to maximum of 10)