Skip to content

Sample proposal: live-match-tracker (long-poll activity w/ heartbeats, retries vs a rate-limited API, continueAsNew per match lifecycle) #509

Description

@bensynapse

Following the README's "find consensus on it in Issues" guidance before opening a PR for a new sample.

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

Proposal: live-match-tracker/ — a workflow that tracks a live tennis match from first point to final, against a real external API.

nestjs-exchange-rates already establishes the precedent of a sample built on a real third-party API, and polling/infrequent + activities-cancellation-heartbeating demonstrate the primitives in isolation. This sample would put them together in one concrete, end-to-end story where the Temporal-native concerns are the actual point:

  • Long-poll activity with heartbeatssrc/activities.ts fetches live match state, heartbeating so cancellation lands promptly when a match is abandoned (same shape as activities-cancellation-heartbeating/src/activities.ts).
  • Retry policy vs a genuinely rate-limited API — the free tier is 30 req/min / 100 req/day, so the retry/backoff configuration handles real 429s rather than simulated ones.
  • condition + continueAsNew per match lifecyclesrc/workflows.ts polls until the match is final; matches run for hours, so the workflow rolls over with continueAsNew to keep history bounded.

Layout would follow the standard sample shape: src/activities.ts, src/workflows.ts, src/worker.ts, src/client.ts, README (which would be honest that the free tier suits developing/testing the sample at a slow cadence, not fast production polling).

Happy to build the whole thing to the repo's conventions (pnpm workspace config files, lint, .post-create) and I'll provide a free API key for whoever reviews so it runs without signup. Equally fine if you'd rather keep sample scope tighter — a "no thanks" costs you one comment.

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