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

Race between event handlers and read model facade after commands #4

Open
t-nelis opened this issue Jan 8, 2015 · 1 comment
Open

Comments

@t-nelis
Copy link

t-nelis commented Jan 8, 2015

In case anyone's wondering, there are races between event handlers and the read model facade after commands are issued. This is due to the use of ThreadPool.QueueUserWorkItem in FakeBus.Publish.

You can test one for example by creating a new item and freezing one of the threads handling the InventoryItemCreated event (simulating a long database request); the resulting view will not display the item you just created.

Note that this is no eventual consistency matter.

This shouldn't impact the overall architecture which is the point of this project -- just pointing this out so that nobody embarks on a journey looking for magic and finding bugs instead.

@beachwalker
Copy link

How to ensure the order of events? seems to be a contract that a Created_Event has to be processed by the handler before any following Changed_Events should be processed. Otherwise there are race conditions, too.

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

No branches or pull requests

2 participants