Skip to content

feat(engine): implement asynchronous range download engine, token bucket rate limiter, and CLI interface #39

Description

@archittmittal

Objective & Overview

Integrate all storage and algorithmic components into the core asynchronous download orchestrator, implement the token bucket rate limiter, and expose the user CLI via Click.

Technical Specification & Design

  • Rate Limiting: Millisecond-resolution async Token Bucket bandwidth throttler.
  • Async Orchestration: httpx.AsyncClient connection pooling, HTTP/2 multiplexing, HEAD probe capability detector.
  • Signal Handling: SIGINT (Ctrl+C) graceful shutdown saving state before termination.
  • CLI: Commands for download, resume, verify, status, manifest, clean with Rich progress bars.

Key Deliverables & Module Breakdown

  • src/rate_limiter.py: Token bucket rate limiter
  • src/download_engine.py: Async download engine and worker pool
  • src/main.py: Click CLI interface and commands

Acceptance Criteria & Checkpoints

  • Rate limiting accurate within $\pm 3%$ of limit
  • Single-stream fallback mode functional
  • CLI execution and graceful shutdown verified

Documentation References

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