Skip to content

Add ResolveOption.AllowStale to Resolver #157

@bartelink

Description

@bartelink

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions