Skip to content

Sample proposal: live_scores/ — a real-API application of the polling/ patterns #350

Description

@bensynapse

Disclosure up front: I run the Live Tennis API, so this is vendor-authored — judge accordingly.

Proposal: live_scores/ — a concrete, real-API application of the polling/ patterns: a workflow that follows a live tennis match until it's final.

The polling/ family (frequent, infrequent, periodic_sequence) teaches the patterns against a mock test_service.py; this sample would show the same frequent-style shape against a real rate-limited API, where the retry policy and backoff have to handle actual 429s (free tier: 30 req/min, 100 req/day). The recently merged LiteLLM activity sample (#343) suggests externally contributed, real-service samples are in scope, which is why I'm asking here first.

Layout mirroring polling/frequent:

  • activities.py — httpx calls to /live and /fixtures, heartbeating activity
  • workflows.py — poll-until-final workflow, backoff tuned to the documented rate limits
  • run_worker.py / run_frequent.py-style starter
  • README.md — honest about cadence: the free tier suits developing/testing the sample, not fast continuous polling

I'd build it to repo conventions (uv, tests under tests/ if you want them) and will provide a free API key for whoever reviews so it runs without signup. If it's out of scope, no problem — happy to hear that too.

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