Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Highest applied sequence number is only updated after full replay/catchup #261
Since #159 the
The drawback of the current implementation: Everything is wrapped in a transaction that is only committed at the end of
To solve this we should commit the transaction for every event instead.
Bonus: allow the batch size to be changed for faster replays/catchups
Previously the whole `EventListenerInvoker::catchup()` call triggered a single blocking transaction that was only committed when the corresponding event listener was up to date with the event store. Especially for replays and initial catchups this posed a problem because of the ever growing transaction. With this change the "Highest Applied Sequence Number" is released after each applied event. This has the nice side effect that multiple workers can share the load: While process 1 commits the transaction, process 2 can already start processing the next event. For batch-processing the batch size can be increased in order to improve performance: $eventListenerInvoker = (new EventListenerInvoker($eventStore, $listener, $connection)) ->withTransactionBatchSize(500) ->catchup() This is a breaking change because the signature of the `EventListenerInvoker` has changed slightly: Previously: $eventListenerInvoker = new EventListenerInvoker($eventStore); $eventListenerInvoker->catchup($listener, $progressCallback); Now: $eventListenerInvoker = new EventListenerInvoker($eventStore, $listener, $connection); $eventListenerInvoker->onProgress($eventListenerInvoker); $eventListenerInvoker->catchup(); Fixes: neos#261