Engine

2.4. Expected revision🔗

expected_revision is optional; it guards against concurrent writers: the event is stored only if its key has exactly that many events. A new key has 0. On the folio:

Event sent

Answer

Claim

FolioOpened expecting revision 0

accepted

Opening a new folio expecting revision 0 is accepted.

a charge expecting revision 1, after FolioOpened

accepted

A charge expecting the current revision is accepted.

a charge expecting revision 1, after FolioOpened and a charge

rejected: the revision is 2

A charge expecting an older revision is rejected.