Alan Gabriel Bem
Alan Gabriel Bem
Aggregates should be able to support internal event sourced entities, which means those entities would actually generate events and be able to replay them. It could be powerful thing because...
Subscription could catch exception that was thrown by underlying listener and `$this->applyEvent(SubscriptionCaughtAnException($e->getMessage(), $version, $now));` and stop listening (until next run of its `streak:subscription:run`) and maybe even sleep for some number...
It uses `COUNT()` in one of underlying SQL query - get rid of that.
...that uses data collected during tests. phpunit extension?
Basically somehow change `Subscriber`s from in memory event bus listeners into full-blown subscriptions that are dispatching `new StartSubscription($id, $event)` commands. Of course those subscriptions would have to become command handlers.
Check out https://github.com/tebru/gson-php
Now you have to add internal state of event sourcing aggregate trait manually e.g. ``` use Streak\Domain\Event\Sourcing; public function fromMemento(array $memento) { $this->accounts = $memento['accounts']; // event sourced aggregate trait...