Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ResolveOption.AllowStale to Resolver #157

Closed
2 tasks done
bartelink opened this issue Sep 4, 2019 · 0 comments · Fixed by #167
Closed
2 tasks done

Add ResolveOption.AllowStale to Resolver #157

bartelink opened this issue Sep 4, 2019 · 0 comments · Fixed by #167
Milestone

Comments

@bartelink
Copy link
Collaborator

bartelink commented Sep 4, 2019

Resolves originally used the Target alone to signal load hints. One of these being Target.AggregateIdEmpty, which signals that the system should not attempt to load the stream when necessitated by a Query or Transact, but (e.g. if the client has just minted a fresh stream id) should instead work on the assumption that no events will be loaded.

This concept generalizes to having a read mode option, which allows one to specify the following:

  • AssumeEmpty - as in OP , check cache, but if no value held, assume empty stream
  • AllowStale - hint that if a cached value is present that a a read should optimistically use that state and position for a first attempt (for an execution cycle, that means leaning on the conflict detection to trigger an automatic resync iff we're on a node whose cache happens to be stale wrt the given stream - for a read, it means you're not going to be able to guarantee that you're yielding the freshest state available in the cluster)
  • 🤔 if Equinox.Cosmos ever needs an equivalent of Equinox.EventStore.CachingStrategy.SlidingWindowPrefixed, a prefix could potentially be supplied via this mechanism
@bartelink bartelink added this to the 2.0 milestone Sep 4, 2019
@bartelink bartelink changed the title Add UseCached mode to Resolver Add ResolveOption.UseCached to Resolver Sep 23, 2019
@bartelink bartelink changed the title Add ResolveOption.UseCached to Resolver Add ResolveOption.AllowStale to Resolver Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant