Skip to content

Commit

Permalink
Tidy accessStrategy
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Feb 14, 2020
1 parent 6618e38 commit e1a7d8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion equinox-fc/Domain/InventorySeries.fs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ module Cosmos =

open Equinox.Cosmos

let accessStrategy = AccessStrategy.Snapshot (Fold.isOrigin, Fold.snapshot)
let resolve (context, cache) =
let cacheStrategy = CachingStrategy.SlidingWindow (cache, System.TimeSpan.FromMinutes 20.)
// For this stream, we uniformly use stale reads as:
// a) we don't require any information from competing writers
// b) while there are competing writers [which might cause us to have to retry a Transact], this should be infrequent
let opt = Equinox.ResolveOption.AllowStale
let accessStrategy = AccessStrategy.Snapshot (Fold.isOrigin, Fold.snapshot)
fun id -> Resolver(context, Events.codec, Fold.fold, Fold.initial, cacheStrategy, accessStrategy).Resolve(id, opt)
let createService (context, cache) =
createService (resolve (context, cache))

0 comments on commit e1a7d8f

Please sign in to comment.