CatchUpHookInterface
interface CatchUpHookInterface (View source)
This is an internal 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\CatchUpHookFactoryInterface} and pass it to {\Neos\ContentRepository\Core\Projection\ProjectionFactoryInterface::build()}.
Methods
This hook is called at the beginning of {ProjectionInterface::catchUpProjection()}; BEFORE the Database Lock is acquired (by {CheckpointStorageInterface::acquireLock()}).
This hook is called for every event during the catchup process, before the projection is updated. Thus, this hook runs AFTER the database lock is acquired.
This hook is called for every event during the catchup process, after the projection is updated. Thus, this hook runs AFTER the database lock is acquired.
This hook is called directly before the database lock is RELEASED in {CheckpointStorageInterface::updateAndReleaseLock()}.
This hook is called at the END of {ProjectionInterface::catchUpProjection()}, directly before exiting the method.
Details
void
onBeforeCatchUp()
This hook is called at the beginning of {ProjectionInterface::catchUpProjection()}; BEFORE the Database Lock is acquired (by {CheckpointStorageInterface::acquireLock()}).
void
onBeforeEvent(EventInterface $eventInstance, EventEnvelope $eventEnvelope)
This hook is called for every event during the catchup process, before the projection is updated. Thus, this hook runs AFTER the database lock is acquired.
void
onAfterEvent(EventInterface $eventInstance, EventEnvelope $eventEnvelope)
This hook is called for every event during the catchup process, after the projection is updated. Thus, this hook runs AFTER the database lock is acquired.
void
onBeforeBatchCompleted()
This hook is called directly before the database lock is RELEASED in {CheckpointStorageInterface::updateAndReleaseLock()}.
It can happen that this method is called multiple times, even without having seen Events in the meantime.
If there exist more events which need to be processed, the database lock is directly acquired again after it is released.
void
onAfterCatchUp()
This hook is called at the END of {ProjectionInterface::catchUpProjection()}, directly before exiting the method.
At this point, the Database Lock has already been released.