Implement run_projection free function (ADR-029) #258
Labels
No labels
adr
automated
bug
chore
dependencies
documentation
enhancement
epic
github-actions
P1-high
P2-medium
P3-low
release
research
rust
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jwilger/eventcore#258
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
Replace
ProjectionRunnerstruct withrun_projection(projector, &backend)free function per ADR-029 and ARCHITECTURE.md v2.7.Parent Epic: #237
Context
Issue #239 implemented the
ProjectorCoordinatortrait and backends:InMemoryProjectorCoordinatorfor single-process deploymentsPostgresProjectorCoordinatorusingpg_try_advisory_lockADR-029 (accepted 2025-12-30) simplified the API:
execute(command, &store)ergonomicsRequired Changes
Per ADR-029 and ARCHITECTURE.md v2.7:
Implementation
run_projectionfree function ineventcore/src/projection.rsEventReader + CheckpointStore + ProjectorCoordinatortry_acquire()at start, hold guard for durationProjectionError::CoordinationErrorif leadership unavailableProjectionRunnerstructAPI Change
Before:
After:
Acceptance Criteria
run_projection(projector, &backend)free function createdEventReader + CheckpointStore + ProjectorCoordinatorrun_projectionacquires leadership before processing eventsProjectionErrorif leadership unavailable (non-blocking per ADR-028)ProjectionRunnerstruct removed or deprecatedInMemoryEventStoreimplements all three traitsPostgresEventStoreimplements all three traitsReferences