Skip to content

Commit

Permalink
Tidying nit re accessStrategy
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Feb 14, 2020
1 parent 52afebe commit 4c6d281
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion propulsion-all-projector/TodoSummary.fs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ module Cosmos =

open Equinox.Cosmos // Everything until now is independent of a concrete store

let accessStrategy = Equinox.Cosmos.AccessStrategy.RollingState Fold.snapshot
let private resolve (context, cache) =
let cacheStrategy = CachingStrategy.SlidingWindow (cache, System.TimeSpan.FromMinutes 20.)
let accessStrategy = Equinox.Cosmos.AccessStrategy.RollingState Fold.snapshot
Resolver(context, Events.codec, Fold.fold, Fold.initial, cacheStrategy, accessStrategy).Resolve
let create (context, cache) = create (resolve (context, cache))
2 changes: 1 addition & 1 deletion propulsion-summary-consumer/TodoSummary.fs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ module Cosmos =

open Equinox.Cosmos // Everything until now is independent of a concrete store

let accessStrategy = Equinox.Cosmos.AccessStrategy.RollingState Fold.snapshot
let private resolve (context, cache) =
let cacheStrategy = CachingStrategy.SlidingWindow (cache, System.TimeSpan.FromMinutes 20.)
let accessStrategy = Equinox.Cosmos.AccessStrategy.RollingState Fold.snapshot
Resolver(context, Events.codec, Fold.fold, Fold.initial, cacheStrategy, accessStrategy).Resolve
let create (context, cache) = create (resolve (context, cache))
2 changes: 1 addition & 1 deletion propulsion-summary-projector/Todo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ module Cosmos =

open Equinox.Cosmos // Everything until now is independent of a concrete store

let accessStrategy = AccessStrategy.Snapshot (Fold.isOrigin, Fold.snapshot)
let private resolve (context, cache) =
let cacheStrategy = CachingStrategy.SlidingWindow (cache, System.TimeSpan.FromMinutes 20.)
let accessStrategy = AccessStrategy.Snapshot (Fold.isOrigin, Fold.snapshot)
Resolver(context, Events.codec, Fold.fold, Fold.initial, cacheStrategy, accessStrategy).Resolve
let create (context, cache) = resolve (context, cache) |> create

Expand Down
3 changes: 1 addition & 2 deletions propulsion-tracking-consumer/SkuSummary.fs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ module Cosmos =

open Equinox.Cosmos // Everything until now is independent of a concrete store

let accessStrategy = AccessStrategy.Snapshot (Fold.isOrigin, Fold.snapshot)
let private resolve (context, cache) =
// We don't want to write any events, so here we supply the `transmute` function to teach it how to treat our events as snapshots
let accessStrategy = AccessStrategy.Snapshot(Fold.isOrigin, Fold.snapshot)
let cacheStrategy = CachingStrategy.SlidingWindow (cache, System.TimeSpan.FromMinutes 20.)
Resolver(context, Events.codec, Fold.fold, Fold.initial, cacheStrategy, accessStrategy).Resolve
let create (context, cache) = create (resolve (context, cache))

0 comments on commit 4c6d281

Please sign in to comment.