Skip to content

Commit

Permalink
TASK: Catchups will only be able to access the state of the projectio…
Browse files Browse the repository at this point in the history
…n they are registered for

A catchup doesn't have access to the full content repository, as it would allow full recursion via handle and accessing other projections
state is not safe as the other projection might not be behind - the order is undefined.

This will make it possible to catchup projections from outside of the cr instance as proposed here: neos/neos-development-collection#5321
  • Loading branch information
mhsdesign committed Nov 2, 2024
1 parent e7f9851 commit 7b98cf2
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@

namespace Neos\ContentRepositoryRegistry\SubgraphCachingInMemory;

use Neos\ContentRepository\Core\ContentRepository;
use Neos\ContentRepository\Core\Projection\CatchUpHookFactoryInterface;
use Neos\ContentRepository\Core\Projection\CatchUpHookInterface;
use Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphReadModelInterface;
use Neos\ContentRepository\Core\Projection\ProjectionStateInterface;
use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;

/**
* Factory for {@see FlushSubgraphCachePoolCatchUpHook}, auto-registered in Settings.yaml for GraphProjection
*
* @implements CatchUpHookFactoryInterface<ContentGraphReadModelInterface>
* @internal
*/
class FlushSubgraphCachePoolCatchUpHookFactory implements CatchUpHookFactoryInterface
Expand All @@ -20,7 +23,8 @@ public function __construct(
private readonly SubgraphCachePool $subgraphCachePool
) {
}
public function build(ContentRepository $contentRepository): CatchUpHookInterface

public function build(ContentRepositoryId $contentRepositoryId, ProjectionStateInterface $projectionState): CatchUpHookInterface
{
return new FlushSubgraphCachePoolCatchUpHook($this->subgraphCachePool);
}
Expand Down

0 comments on commit 7b98cf2

Please sign in to comment.