| 1 | <?php |
||
| 10 | class TransactionalEventBus implements EventBus |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var EventBus |
||
| 14 | */ |
||
| 15 | private $eventBus; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var TransactionManager |
||
| 19 | */ |
||
| 20 | private $transactionManager; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param EventBus $eventBus |
||
| 24 | * @param TransactionManager $transactionManager |
||
| 25 | */ |
||
| 26 | 9 | public function __construct(EventBus $eventBus, TransactionManager $transactionManager) |
|
| 31 | |||
| 32 | /** |
||
| 33 | * Subscribes the event listener to the event bus. |
||
| 34 | * |
||
| 35 | * @param EventListener $eventListener |
||
| 36 | */ |
||
| 37 | 3 | public function subscribe(EventListener $eventListener) |
|
| 41 | |||
| 42 | /** |
||
| 43 | * Publishes the events from the domain event stream to the listeners. |
||
| 44 | * |
||
| 45 | * @param DomainEventStream $domainMessages |
||
| 46 | * @throws \Exception |
||
| 47 | */ |
||
| 48 | 6 | public function publish(DomainEventStream $domainMessages) |
|
| 59 | } |
||
| 60 |