|
2 | 2 |
|
3 | 3 | ## Subscription |
4 | 4 |
|
5 | | -* The constructor of the `SubscriptionEngine` class has been changed |
6 | | -* * Instead of passing a `Store` instance, you now need to pass a `MessageLoader` instance. |
7 | | -* * Instead of passing a `RetryStrategy` instance, you now need to pass a `RetryStrategyRepository` instance. |
| 5 | +The constructor of the `DefaultSubscriptionEngine` class has been changed. |
| 6 | +* Instead of passing a `Store` instance, you now need to pass a `MessageLoader` instance. |
| 7 | +* Instead of passing a `RetryStrategy` instance, you now need to pass a `RetryStrategyRepository` instance. |
| 8 | + |
| 9 | +before: |
| 10 | + |
| 11 | +```php |
| 12 | +use Patchlevel\EventSourcing\Store\Store; |
| 13 | +use Patchlevel\EventSourcing\Subscription\Engine\DefaultSubscriptionEngine; |
| 14 | +use Patchlevel\EventSourcing\Subscription\RetryStrategy\RetryStrategy; |
| 15 | +use Patchlevel\EventSourcing\Subscription\Store\DoctrineSubscriptionStore; |
| 16 | +use Patchlevel\EventSourcing\Subscription\Subscriber\MetadataSubscriberAccessorRepository; |
| 17 | + |
| 18 | +/** |
| 19 | + * @var Store $store |
| 20 | + * @var DoctrineSubscriptionStore $subscriptionStore |
| 21 | + * @var MetadataSubscriberAccessorRepository $subscriberAccessorRepository |
| 22 | + * @var RetryStrategy $retryStrategy |
| 23 | + */ |
| 24 | +$subscriptionEngine = new DefaultSubscriptionEngine( |
| 25 | + $messageLoader, |
| 26 | + $subscriptionStore, |
| 27 | + $subscriberAccessorRepository, |
| 28 | + $retryStrategy, |
| 29 | +); |
| 30 | +``` |
| 31 | +after: |
| 32 | + |
| 33 | +```php |
| 34 | +use Patchlevel\EventSourcing\Store\Store; |
| 35 | +use Patchlevel\EventSourcing\Subscription\Engine\DefaultSubscriptionEngine; |
| 36 | +use Patchlevel\EventSourcing\Subscription\Engine\StoreMessageLoader; |
| 37 | +use Patchlevel\EventSourcing\Subscription\RetryStrategy\RetryStrategy; |
| 38 | +use Patchlevel\EventSourcing\Subscription\RetryStrategy\RetryStrategyRepository; |
| 39 | +use Patchlevel\EventSourcing\Subscription\Store\DoctrineSubscriptionStore; |
| 40 | +use Patchlevel\EventSourcing\Subscription\Subscriber\MetadataSubscriberAccessorRepository; |
| 41 | + |
| 42 | +/** |
| 43 | + * @var Store $store |
| 44 | + * @var DoctrineSubscriptionStore $subscriptionStore |
| 45 | + * @var MetadataSubscriberAccessorRepository $subscriberAccessorRepository |
| 46 | + * @var RetryStrategy $retryStrategy |
| 47 | + */ |
| 48 | +$subscriptionEngine = new DefaultSubscriptionEngine( |
| 49 | + new StoreMessageLoader($store), |
| 50 | + $subscriptionStore, |
| 51 | + $subscriberAccessorRepository, |
| 52 | + RetryStrategyRepository::withDefault($retryStrategy), |
| 53 | +); |
| 54 | +``` |
0 commit comments