| 1 | <?php |
||
| 13 | class TransactionalCommandBus |
||
| 14 | { |
||
| 15 | /** @var CommandBus */ |
||
| 16 | private $decorated; |
||
| 17 | /** @var TransactionManager */ |
||
| 18 | private $transactionManager; |
||
| 19 | /** @var LoggerInterface */ |
||
| 20 | private $logger; |
||
| 21 | |||
| 22 | public function __construct(CommandBus $bus, TransactionManager $transactionManager, LoggerInterface $logger) |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param mixed $command |
||
| 31 | * |
||
| 32 | * @throws Throwable |
||
| 33 | */ |
||
| 34 | public function dispatch($command) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param CommandHandler $handler |
||
| 49 | */ |
||
| 50 | public function subscribe(CommandHandler $handler) |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param $exception |
||
| 57 | * |
||
| 58 | * @throws Exception |
||
| 59 | */ |
||
| 60 | private function rollback($exception) |
||
| 69 | } |
||
| 70 |