we support setting that flag, but we don't currently (i think) handle the errors that would come back.
implementation would be in the async def reply() of class WriteEvents. currently the only special case is for AccessDenied. we should add a check for whatever the expected-version-error is.
at that point the reply() method will be quite long. consider switching to the same pattern we use for Read conversations, which is delegating to a wrapper called eg WriteEventCompleted which defines a .dispatch() method. See for example ReadEvent.reply() and class ReadEventCompleted
eventstore supports setting
expected_version
on an event, to allow for optimistic concurrencyhttps://eventstore.com/docs/http-api/creating-writing-a-stream/index.html?tabs=tabid-1%2Ctabid-3%2Ctabid-5%2Ctabid-7%2Ctabid-17%2Ctabid-11%2Ctabid-13%2Ctabid-15#expected-version-header
we support setting that flag, but we don't currently (i think) handle the errors that would come back.
implementation would be in the
async def reply()
ofclass WriteEvents
. currently the only special case is forAccessDenied
. we should add a check for whatever the expected-version-error is.at that point the
reply()
method will be quite long. consider switching to the same pattern we use for Read conversations, which is delegating to a wrapper called egWriteEventCompleted
which defines a.dispatch()
method. See for exampleReadEvent.reply()
andclass ReadEventCompleted