daikon-cqrs / event-sourcing

Immutable CQRS/ES library for Daikon-CQRS projects.
Mozilla Public License 2.0
7 stars 1 forks source link

Handle concurrent and conflicting changes #1

Open shrink0r opened 7 years ago

shrink0r commented 7 years ago

I think we have a good starting point now for resolving concurrent changes to aggregates. 🎊 In the end it would be nice to have the uow return a proper result to the command-handler for indicating concurrency conflicts, instead of raising exceptions, as is done right now. We could then introduce a conflicts channel to the message-bus, which would enable us to send feedback to the command issuer and other interested parties. This would leave exceptions for indicating serious problems only e.g. failing connectivity etcetera, thus making it easier for the command-handler to distinguish between the latter kind of failure and domain defined errors. It might even make sense to add another channel: errors to the message-bus for sending information on exceptions. As commands have this notion of fire and forget, this could be a nice way to ensure feedback is given to the command issuer in every case.

graste commented 7 years ago

This could be useful to implement circuit breakers as well.

MrHash commented 4 years ago

I've tidied this up wrt to concurrency checks across commit streams