eventhorizon
eventhorizon copied to clipboard
[commandbus] Local command bus should only handle one command per aggregate ID at a time
Is this fixed? Will it cause race condition?
This is not fixed, it may cause race conditions depending on your setup of event handlers (projections, sagas etc).
if using SimpleEventHandlingStrategy then it shouldn't be any race condition? Anyway, thanks for your amazing work @maxekman
Thanks!
Yes, that will at least make it more predictable. It all depends on if you dispatch commands from different goroutines or not (dispatching on HTTP requests will be concurrent for example).
Is there already a solution for this issue here? And if not, what would be the steps to implement one?
Not yet in the library. You can either rely on the event store dictating which command gets saved first (the other fails) or you could write your own wrapper which for example keeps a map of IDs that are currently being handled.