Skip to content

Commit 2a394f3

Browse files
committed
full list of changes below:
- fixed registering listeners within container - configured subscription repository using projection
1 parent 0ff22c7 commit 2a394f3

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

src/DependencyInjection/StreakExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function load(array $configs, ContainerBuilder $container)
2929
$loader->load('services.yaml');
3030
$loader->load('command_handlers.yaml');
3131
$loader->load('query_handlers.yaml');
32+
$loader->load('projectors.yaml');
3233
}
3334

3435
public function getNamespace()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
streak.listener.subscriptions_projector.factory:
3+
class: Streak\Application\Listener\Subscriptions\Projector\Factory
4+
arguments:
5+
- '@streak.dbal.postgres.event_store.connection'
6+
- '@streak.clock'
7+
tags:
8+
- 'streak.listener_factory'

src/Resources/config/services.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ services:
6767
- '@streak.event_store'
6868
- '@streak.unit_of_work'
6969

70-
streak.subscription_repository: '@streak.event_sourced.subscription_repository'
70+
streak.subscriptions_projection.subscription_repository:
71+
class: Streak\Infrastructure\Event\Subscription\ProjectionRepository
72+
arguments:
73+
- '@streak.event_sourced.subscription_repository'
74+
- '@streak.query_bus'
75+
76+
streak.subscription_repository: '@streak.subscriptions_projection.subscription_repository'
7177

7278
streak.null.event_bus:
7379
class: Streak\Infrastructure\EventBus\NullEventBus
@@ -237,6 +243,7 @@ services:
237243
Streak\Domain\EventBus: '@streak.event_bus'
238244
Streak\Application\CommandHandler: '@streak.command_handler'
239245
Streak\Application\CommandBus: '@streak.command_bus'
246+
Streak\Application\QueryBus: '@streak.query_bus'
240247
Streak\Domain\EventStore: '@streak.event_store'
241248
Streak\Domain\AggregateRoot\Factory: '@streak.aggregate_factory'
242249
Streak\Infrastructure\AggregateRoot\Snapshotter: '@streak.snapshotter'

0 commit comments

Comments
 (0)