Skip to content

Conversation

@mbenabda
Copy link

As Vaugh Vernon said in #6 :

The DomainEventPublisher must protect itself from the subscribers. For
example, when a subscriber's handle() method has been called back on, the
handle() method could attempt to register another subscriber. Even though
it's all happening on a single thread, that would cause a
ConcurrentModificationException on the collection.

Nevertheless, it should be possible to publish an event from inside a subsciber's handle() method, to propagate whatever side effects on the domain model the parent DomainEvent handling might produce.

@mbenabda mbenabda changed the title allow publishing while handling a DomainEvent allow publishing while handling a DomainEvent & dispatch events from subclasses to the subscribers of parent classes Aug 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants