Open dima-zhemkov opened 4 years ago
Hi, I believe such thing is covered inside ISagaCoordinator
:
using (await Locker.LockAsync(id))
{
var (isInitialized, state) = await _initializer.TryInitializeAsync(saga, id, message);
if (!isInitialized)
{
return;
}
await _processor.ProcessAsync(saga, message, state, context);
await _postProcessor.ProcessAsync(saga, message, context, onCompleted, onRejected);
}
Therefore adding the revision/version should not be necessary.
Hi, I believe such thing is covered inside
ISagaCoordinator
:using (await Locker.LockAsync(id)) { var (isInitialized, state) = await _initializer.TryInitializeAsync(saga, id, message); if (!isInitialized) { return; } await _processor.ProcessAsync(saga, message, state, context); await _postProcessor.ProcessAsync(saga, message, context, onCompleted, onRejected); }
Therefore adding the revision/version should not be necessary.
It will work only if you process saga on a single PC.
That's a good point... I need to come up with some sort of distributed storage for such a scenario. Will do my best to deliver this quite soon.
That's a good point... I need to come up with some sort of distributed storage for such a scenario. Will do my best to deliver this quite soon.
Any update :D?
It would be good to be able to perform optimistic concurrency check to avoid data corruption when running a few instances at the same time.
I propose to add
Revision
property of typeuint
to theISagaState
.