Repository navigation
FEATURE: Bounded catch-ups via limit parameter - #13
Merged
Merged
Conversation
…ched A catch-up that found nothing but detached subscriptions returned early without restoring the processing state. Every following catch-up without criteria on the same engine instance then failed with a RecursiveCatchUpException.
A catch-up with a limit reads at most that number of events, persists the positions and commits, which releases the lock of the subscriptions. ProcessedResult::$hasPendingEvents reports whether another call could process more events. Partially booted subscriptions stay BOOTING until no events are pending. BREAKING: Implementations of EventStoreAdapter::read() have to accept the new $limit parameter.
limit parameter
This was referenced Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
catchUpActive()andboot()get an optionallimit. A bounded call reads at most that number of events, persists positions and commits, so workers can take turns between calls.limit, behavior is unchanged: one transaction, read to the end of the event loglimitcounts events read, including skipped onesProcessedResultandCatchUpFinishedgainhasPendingEventsEventStoreAdapter::read(Position $startPosition, int|null $limit = null)maingets the branch alias2.x-dev, so packages using composer-studio resolve the local core against^1 || ^2The reasoning, known consequences and open points are in
docs/decisions.md.Related: bwaidelich/subscription-engine-dcb-adapter#3, bwaidelich/subscription-engine-neos-adapter#1, bwaidelich/subscription-engine-doctrine#9
Evidence
Before:
catchUpActive(limit: 2)fails withUnknown named parameter $limitAfter:
OK (67 tests, 186 assertions), and CI is green on PHP 8.3, 8.4 and 8.5Before: two consecutive
catchUpActive()calls with only a detached subscription:RecursiveCatchUpExceptionon the second callAfter: the second call succeeds and processes 0 events
The real dcb and neos adapters against this branch (5 events,
boot(limit: 2), in-memory subscription store) gave the same output:Not tested: locking and rotation between real workers on MySQL or PostgreSQL.
Merge Danger
Door: two-way until 2.0 is tagged, one-way after that
read()is expected to change again with the event filter follow-up. The README says so, and the adapters shouldn't be tagged before it is final.Blast Radius: implementers
Every
EventStoreAdapterwithout the new parameter fails with a fatal error on 2.x. Callers aren't affected unless they pass alimit. A laggard holds back the other subscriptions of a bounded run, whichdocs/decisions.mdcovers.