Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow publishing while handling a DomainEvent & dispatch events from subclasses to the subscribers of parent classes #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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