pub struct TokioClientConfig {
pub request_timeout: Duration,
pub blocking_timeout: Duration,
pub max_resource_retries: u32,
pub retry_backoff: Duration,
pub max_retry_backoff: Duration,
pub auth: Option<Credentials>,
pub connect_timeout: Duration,
pub jitter: bool,
pub cancel: CancellationToken,
pub max_body_bytes: usize,
}tokio only.Expand description
Tunables for TokioClient. Default gives sane values for a
well-behaved LL-HLS origin reachable over a real (or loopback) network.
Fields§
§request_timeout: DurationPer-request timeout for a plain (non-blocking) playlist GET, or a resource (init/part/segment) GET.
blocking_timeout: DurationPer-request timeout for a blocking Playlist Reload
(_HLS_msn/_HLS_part, RFC 8216bis §6.2.5.2) — must exceed the
origin’s own blocking hold time (e.g. multimux’s LlHlsOutput caps
at 5s) with headroom, since the origin is expected to hold the
response open until new content exists or its own cap elapses.
max_resource_retries: u32How many times a resource fetch is retried (capped exponential backoff) before the adapter gives up on that specific fetch and moves on (see the module docs’ “Error recovery” section). A playlist reload is never subject to this cap — it retries indefinitely.
retry_backoff: DurationInitial backoff between retry attempts (backon’s minimum delay);
doubles per attempt up to Self::max_retry_backoff.
max_retry_backoff: DurationCeiling the doubled Self::retry_backoff is capped at.
auth: Option<Credentials>Optional auth attached to every request to the playlist URL’s origin (see the module docs).
connect_timeout: DurationTCP connect timeout (reqwest’s connect_timeout). Default 10 s.
jitter: boolAdd backon jitter to every retry delay (each delay d becomes a
random value in [d, 2d), clamped to Self::max_retry_backoff, which
stays a hard maximum). Default true.
cancel: CancellationTokenCancelling this token makes TokioClient::next_output abandon its
in-flight request or backoff sleep and return Ok(None).
max_body_bytes: usizeLargest response body (playlist, key, init, part or segment) the
adapter will read; a larger one is abandoned mid-read with
TokioError::BodyTooLarge. Default DEFAULT_MAX_BODY_BYTES.
Implementations§
Source§impl TokioClientConfig
impl TokioClientConfig
Sourcepub fn with_auth(self, auth: Credentials) -> Self
pub fn with_auth(self, auth: Credentials) -> Self
Set Self::auth.
Sourcepub fn with_cancel(self, cancel: CancellationToken) -> Self
pub fn with_cancel(self, cancel: CancellationToken) -> Self
Set Self::cancel.
Sourcepub fn with_jitter(self, on: bool) -> Self
pub fn with_jitter(self, on: bool) -> Self
Set Self::jitter.