Skip to content

feat: configure resumable HTTP retry and validation behavior #84

Description

@digizeph

Context

ResumableHttpReader uses a fixed retry policy: five connection attempts with a 200 ms exponential backoff. It also accepts a resumed resource optimistically when the original response provides neither ETag nor Last-Modified.

Those defaults are appropriate for the convenience helper, but long-running readers and authenticated/private HTTP endpoints may need explicit control and visibility.

Proposed API

Add a public options type, for example:

ResumableHttpOptions {
    max_retries: 5,
    base_retry_delay: Duration::from_millis(200),
    max_retry_delay: ...,
    validator_policy: ValidatorPolicy::AllowMissing,
}

Expose it through a method such as:

OneIo::get_resumable_http_reader_with_options(url, options)

Keep get_resumable_http_reader as the convenience API and preserve its existing behavior by using the default options.

Scope

  • Configure retry count and backoff.
  • Choose whether a resume requires a response validator.
  • Provide optional resume-attempt observability (for example, a callback or structured log event).
  • Retain Accept-Encoding: identity as a fixed correctness requirement for range requests.

Acceptance criteria

  • Existing callers retain the current retry and validation behavior without source changes.
  • Callers can configure retry limits and delays per reader.
  • Strict validation can reject resources without a usable ETag or Last-Modified.
  • Tests cover default compatibility and each non-default option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions