Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Helper primitive that can be used to constrain contention where multiple threads are targeting a single upstream.
The specific need at hand is where multiple threads in a projector are transacting against the same aggregate. In such a case the duelling transactions trigger
Equinox.Cosmos
Resync
operations / ESDBWrongExpectedVersion
which increases load for the upstream, in addition to increasing latency due to having to retry.Like
AsyncCacheCell
(although that's slightly more justifiable given its used in the impl of Equinox.Cosmos), these helpers are generic; the happen to be useful in typical Concurrent Transaction processing work, but are not "part of Equinox". Hosting this in Equinox.Core is thus not a long term plan - ideally these primitives ultimately end up with their own home at some point (not dissimilar to how Equinox.Codec moved out to FsCodec).