Skip to content

Architect continuous polling mode for run_projection API #276

@jwilger

Description

@jwilger

Context

During the ADR-030 layered API cleanup, we removed PollMode::Continuous as dead code because it wasn't accessible through the public run_projection() API. However, continuous polling is a legitimate use case for long-running projection processes that need to:

  • Poll for new events indefinitely
  • Pause between polls (with configurable backoff when no events found)
  • Keep projections up-to-date in real-time

Problem

The current run_projection() API only supports batch mode - it processes available events once and exits. There's no public API for continuous polling.

Deliverables

  1. ADR documenting the design decision for how continuous polling should be exposed through the public API
  2. Updated ARCHITECTURE.md reflecting the chosen approach
  3. Implementation ticket(s) for the actual work

Design Considerations

  • Should continuous mode be a separate function (run_projection_continuous())?
  • Should it be configured via the Projector trait?
  • Should it be configured via the backend?
  • How should shutdown/cancellation work?
  • What configuration options are needed (poll interval, empty poll backoff)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions