CatchUpHookInterface
interface CatchUpHookInterface (View source)
This is an api with which you can hook into the catch-up process of a projection.
To register such a CatchUpHook, create a corresponding {\Neos\ContentRepository\Core\Projection\CatchUpHook\CatchUpHookFactoryInterface} and pass it to {\Neos\ContentRepository\Core\Projection\CatchUpHook\ProjectionFactoryInterface::build()}.
Methods
This hook is called at the beginning of a catch-up run, after the database lock is acquired, but before any projection was called.
This hook is called for every event during the catchup process, before the projection is updated but in the same transaction.
This hook is called for every event during the catchup process, after the projection is updated but in the same transaction,
This hook is called for each batch of processed events during the catchup process, after the projection and their new position is updated and the transaction is commited.
This hook is called at the END of a catch-up run, after the projection and their new position is updated and the transaction is commited.
Details
void
onBeforeCatchUp(SubscriptionStatus $subscriptionStatus)
This hook is called at the beginning of a catch-up run, after the database lock is acquired, but before any projection was called.
Note that any errors thrown will be collected and the current catchup batch will be finished as normal. The collect errors will be returned and rethrown by the content repository.
void
onBeforeEvent(EventInterface $eventInstance, EventEnvelope $eventEnvelope)
This hook is called for every event during the catchup process, before the projection is updated but in the same transaction.
Note that any errors thrown will be collected and the current catchup batch will be finished as normal. The collect errors will be returned and rethrown by the content repository.
void
onAfterEvent(EventInterface $eventInstance, EventEnvelope $eventEnvelope)
This hook is called for every event during the catchup process, after the projection is updated but in the same transaction,
Note that any errors thrown will be collected and the current catchup batch will be finished as normal. The collect errors will be returned and rethrown by the content repository.
void
onAfterBatchCompleted()
This hook is called for each batch of processed events during the catchup process, after the projection and their new position is updated and the transaction is commited.
The database lock is directly acquired again after it is released if the batching needs to continue. It can happen that this method is called even without having seen events in the meantime.
Note that any errors thrown will be collected but no further batch is started. The collect errors will be returned and rethrown by the content repository.
void
onAfterCatchUp()
This hook is called at the END of a catch-up run, after the projection and their new position is updated and the transaction is commited.
Note that any errors thrown will be collected and the catchup will finish as normal. The collect errors will be returned and rethrown by the content repository.