pub struct FetchPolicy {
pub concurrency: usize,
pub coalesce_gap: u64,
pub max_span: u64,
pub retries: u32,
pub backoff_ms: u64,
pub trace: bool,
pub whole_body_cap: u64,
}Expand description
How HttpRangeReader fetches: fan-out, coalescing, retries, and the
whole-body cap. FetchPolicy::from_env reads it once when a reader opens.
Fields§
§concurrency: usizeRequests in flight at once in read_many (RETE_HTTP_CONCURRENCY,
1–64; 1 fetches a batch sequentially). Also what the reader reports
to the planner as its RangeReader::concurrency.
coalesce_gap: u64Two ranges of one batch at most this many bytes apart are fetched as
one request (RETE_HTTP_COALESCE_KB; 0 merges only touching or
overlapping ranges).
max_span: u64Coalescing never grows a request past this many bytes, so one huge span does not serialize what could have gone out in parallel.
retries: u32Extra attempts for a transiently failing request (RETE_HTTP_RETRIES,
at most 10; 0 = no retry).
backoff_ms: u64The first backoff; it quadruples per retry, capped at 2 s.
trace: boolRETE_HTTP_TRACE: one stderr line per read and per batch, to see which
ranges a query needed and which of them went out together.
whole_body_cap: u64The largest whole body a host that ignores Range may send and still
have it kept (WHOLE_BODY_CAP); a larger one is refused by name.
Implementations§
Source§impl FetchPolicy
impl FetchPolicy
Sourcepub const DEFAULT: FetchPolicy
pub const DEFAULT: FetchPolicy
16 in flight matches the wasm client’s fetch-worker pool and the Node
client’s reteReadMany cap; a CDN or S3 serves that many concurrent
range reads happily.
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
FetchPolicy::DEFAULT with the RETE_HTTP_* overrides applied.
Trait Implementations§
Source§impl Clone for FetchPolicy
impl Clone for FetchPolicy
impl Copy for FetchPolicy
Source§impl Debug for FetchPolicy
impl Debug for FetchPolicy
Source§impl Default for FetchPolicy
impl Default for FetchPolicy
impl Eq for FetchPolicy
Source§impl PartialEq for FetchPolicy
impl PartialEq for FetchPolicy
impl StructuralPartialEq for FetchPolicy
Auto Trait Implementations§
impl Freeze for FetchPolicy
impl RefUnwindSafe for FetchPolicy
impl Send for FetchPolicy
impl Sync for FetchPolicy
impl Unpin for FetchPolicy
impl UnsafeUnpin for FetchPolicy
impl UnwindSafe for FetchPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more