Skip to content

Commit 7283d26

Browse files
committed
update upgrade docs & remove unused noRetry factory
1 parent dc275cf commit 7283d26

3 files changed

Lines changed: 51 additions & 14 deletions

File tree

docs/mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ nav:
113113
- CLI: cli.md
114114
- Supported Versions: supported-versions.md
115115
- Our BC Promise: our-backward-compatibility-promise.md
116-
- Upgrade from 2.x: UPGRADE-3.0.md
116+
- Upgrade from 3.x: UPGRADE-4.0.md
117117
- Links:
118118
- Blog: https://patchlevel.de/blog
119119
- Symfony Bundle: https://patchlevel.github.io/event-sourcing-bundle-docs/latest/

docs/pages/UPGRADE-4.0.md

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,53 @@
22

33
## Subscription
44

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+
```

src/Subscription/RetryStrategy/RetryStrategyRepository.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,4 @@ public static function withDefault(RetryStrategy $retryStrategy): self
3636
self::DEFAULT_STRATEGY_NAME,
3737
);
3838
}
39-
40-
public static function noRetry(): self
41-
{
42-
return new self(
43-
[
44-
self::DEFAULT_STRATEGY_NAME => new NoRetryStrategy(),
45-
],
46-
self::DEFAULT_STRATEGY_NAME,
47-
);
48-
}
4939
}

0 commit comments

Comments
 (0)