Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

projection for subscriptions #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/DependencyInjection/StreakExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function load(array $configs, ContainerBuilder $container)
$loader->load('services.yaml');
$loader->load('command_handlers.yaml');
$loader->load('query_handlers.yaml');
$loader->load('projectors.yaml');
}

public function getNamespace()
Expand Down
8 changes: 8 additions & 0 deletions src/Resources/config/projectors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
streak.listener.subscriptions_projector.factory:
class: Streak\Application\Listener\Subscriptions\Projector\Factory
arguments:
- '@streak.dbal.postgres.event_store.connection'
- '@streak.clock'
tags:
- 'streak.listener_factory'
9 changes: 8 additions & 1 deletion src/Resources/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ services:
- '@streak.event_store'
- '@streak.unit_of_work'

streak.subscription_repository: '@streak.event_sourced.subscription_repository'
streak.subscriptions_projection.subscription_repository:
class: Streak\Infrastructure\Event\Subscription\ProjectionRepository
arguments:
- '@streak.event_sourced.subscription_repository'
- '@streak.query_bus'

streak.subscription_repository: '@streak.subscriptions_projection.subscription_repository'

streak.null.event_bus:
class: Streak\Infrastructure\EventBus\NullEventBus
Expand Down Expand Up @@ -237,6 +243,7 @@ services:
Streak\Domain\EventBus: '@streak.event_bus'
Streak\Application\CommandHandler: '@streak.command_handler'
Streak\Application\CommandBus: '@streak.command_bus'
Streak\Application\QueryBus: '@streak.query_bus'
Streak\Domain\EventStore: '@streak.event_store'
Streak\Domain\AggregateRoot\Factory: '@streak.aggregate_factory'
Streak\Infrastructure\AggregateRoot\Snapshotter: '@streak.snapshotter'
Expand Down