feat: Implement concurrent async fetching with fast-start mode #49

Closed
opened 2026-03-20 02:10:57 +00:00 by david · 0 comments
Owner

Summary

Implemented async/concurrent fetching to improve startup time and enable background refresh.

Changes

engine/fetch.py

  • Replaced sequential fetching with ThreadPoolExecutor (10 workers)
  • All RSS feeds (45) and Gutenberg sources (12) now fetch concurrently
  • Added fetch_all_fast() - grabs headlines from first 5 sources with 3s timeout
  • Poetry also uses concurrent fetching

engine/app/pipeline_runner.py & main.py

  • Uses fast-start mode: launches display with first 5 sources (~3-5s)
  • Runs full fetch in background daemon thread
  • Saves results to cache for next startup

Benefits

  • Fast startup: Display launches in ~3 seconds vs previous worst-case 450s
  • Background refresh: Full content loads while displaying
  • No new dependencies: Uses concurrent.futures.ThreadPoolExecutor

Testing

  • All 15 fetch tests pass
  • All 97 pipeline tests pass
  • Linting passes
  • Part of ongoing performance improvements
## Summary Implemented async/concurrent fetching to improve startup time and enable background refresh. ## Changes ### engine/fetch.py - Replaced sequential fetching with `ThreadPoolExecutor` (10 workers) - All RSS feeds (45) and Gutenberg sources (12) now fetch concurrently - Added `fetch_all_fast()` - grabs headlines from first 5 sources with 3s timeout - Poetry also uses concurrent fetching ### engine/app/pipeline_runner.py & main.py - Uses fast-start mode: launches display with first 5 sources (~3-5s) - Runs full fetch in background daemon thread - Saves results to cache for next startup ## Benefits - **Fast startup**: Display launches in ~3 seconds vs previous worst-case 450s - **Background refresh**: Full content loads while displaying - **No new dependencies**: Uses `concurrent.futures.ThreadPoolExecutor` ## Testing - All 15 fetch tests pass - All 97 pipeline tests pass - Linting passes ## Related - Part of ongoing performance improvements
david closed this issue 2026-03-20 02:24:22 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: klubhaus/sideline#49