DelegatingCatchUpHook
class DelegatingCatchUpHook implements CatchUpHookInterface (View source)
internal |
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
__construct(CatchUpHookInterface ...$catchUpHooks)
No description
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.