Function object_store::coalesce_ranges
source · pub async fn coalesce_ranges<F, E, Fut>(
ranges: &[Range<usize>],
fetch: F,
coalesce: usize
) -> Result<Vec<Bytes>, E>where
F: Send + FnMut(Range<usize>) -> Fut,
E: Send,
Fut: Future<Output = Result<Bytes, E>> + Send,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
coalescebytes apart into a single call tofetch - Make multiple
fetchrequests in parallel (up to maximum of 10)