Skip to content

miniproto.media.download.DownloadRangeCache.prefetch

miniproto.media.download.DownloadRangeCache.prefetch

Section titled “miniproto.media.download.DownloadRangeCache.prefetch”
prefetch(key: str, offset: int, limit: int, fetch: Callable[[], Awaitable[bytes]]) -> None

Schedule a bounded best-effort cached fetch without awaiting its outcome.

Parameters:

  • key (str) – Stable media identity partitioning cache entries.
  • offset (int) – Starting byte of the speculative range.
  • limit (int) – Requested speculative range length.
  • fetch (Callable[[], Awaitable[bytes]]) – Async producer used if this range is not cached or pending.