Skip to main content

ClientBackpressureHandle

Trait ClientBackpressureHandle 

Source
pub trait ClientBackpressureHandle {
    // Required methods
    fn increment_read_window(&mut self, len: usize);
    fn ensure_read_window(&mut self, desired_end_offset: u64);
    fn read_window_end_offset(&self) -> u64;
}
Expand description

A handle for controlling backpressure enabled requests.

If the client was created with enable_read_backpressure set true, each meta request has a flow-control window that shrinks as response body data is downloaded (headers do not affect the size of the window). The client’s initial_read_window determines the starting size of each meta request’s window. If a meta request’s flow-control window reaches 0, no further data will be downloaded. If the initial_read_window is 0, the request will not start until the window is incremented. Maintain a larger window to keep up a high download throughput, parts cannot download in parallel unless the window is large enough to hold multiple parts. Maintain a smaller window to limit the amount of data buffered in memory.

Required Methods§

Source

fn increment_read_window(&mut self, len: usize)

Increment the flow-control read window, so that response data continues downloading.

The client should read data up to and including the end of the read window, even if that means fetching and returning data beyond the end of the window to fulfil a part-sized GetObject request. As an example, a call with len = 1 could trigger an 8MiB GetObject request if the given client fetches data in requests of 8MiB ranges.

Source

fn ensure_read_window(&mut self, desired_end_offset: u64)

Move the upper bound of the read window to the given offset if it’s not already there.

Source

fn read_window_end_offset(&self) -> u64

Get the upper bound of the read window. When backpressure is enabled, [GetObjectRequest] can return data up to this offset exclusively.

Implementors§