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”

Scala software engineer, Functional Programming enthusiast, SoftwareMill co-founder

Scala software engineer, Functional Programming enthusiast, SoftwareMill co-founder