Internal policy helper for Feature A, separated from the download mechanism so
it can be unit-tested without network access. The parallel path is gated on
the opt-in reproducible.urlRemap being set: if no remap function is set,
it is never used, regardless of reproducible.parallel.streams. When a remap
is set, the path is used only when reproducible.parallel.streams > 1 (the
default is 48L; set it to 1L to disable), the curl and httr2
packages are available, the server advertises Accept-Ranges: bytes, and the
file is larger than reproducible.parallel.threshold. When that gate is not
met, the (potentially network-touching) .probeRange() call is skipped
entirely.
.useParallelDownload(
url,
streams = .parallelDownload(),
threshold = getOption("reproducible.parallel.threshold", 10 * 1024^2),
verbose = getOption("reproducible.verbose", 1)
)A list with use (logical) and info (the .probeRange() result, or
NULL when the probe was skipped).
The resolved URL.
Number of parallel streams (reproducible.parallel.streams).
Size threshold in bytes.
Numeric verbosity level.