Module http

Module http 

Source
Expand description

HTTP client for intervals.icu API with rate limiting.

This module provides high-performance activity fetching with:

  • Connection pooling for HTTP/2 multiplexing
  • Dispatch rate limiting (spaces out request starts)
  • Parallel fetching with configurable concurrency
  • Automatic retry with exponential backoff on 429

Structs§

ActivityFetcher
High-performance activity fetcher
ActivityMapResult
Result of fetching activity map data
DownloadProgress
Global progress state for FFI polling. Uses atomics to allow safe concurrent access from fetch tasks and FFI polls.
MapBounds
Map bounds for an activity

Functions§

fetch_activity_maps_sync
Synchronous wrapper for FFI - runs the async code on a tokio runtime Accepts a pre-formatted auth header (e.g., “Basic …” or “Bearer …”)
finish_download_progress
Mark download as complete
get_download_progress
Get current progress state (called by FFI)
increment_download_progress
Increment completed counter after each activity fetches
reset_download_progress
Reset progress counters at start of fetch operation
start_background_fetch
Start a background fetch operation (returns immediately, doesn’t block) Call get_download_progress() to monitor progress Call take_background_fetch_results() when active becomes false to get results
take_background_fetch_results
Take the results from a completed background fetch Returns None if fetch is still in progress or no fetch was started Returns Some(results) and clears the storage

Type Aliases§

ProgressCallback
Progress callback type