Adam Warski
1 min readDec 5, 2019

--

One way to handle this situation, if you need to operate on the “current state” of the entity E, is to treat commands as events as well.

You’ll need to emit an event “command C1/C2 happened”, and then wait until the command gets processed. Only the processor, which folds the events onto the state store knows if the command can get processed or not. This can lead to another event, e.g. “C1 processed successfuly”

--

--

Adam Warski

Software engineer, Functional Programming and Scala enthusiast, SoftwareMill co-founder