Skip to content

Commit e73d6f3

Browse files
committed
Stragglers
1 parent ba7c315 commit e73d6f3

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

equinox-fc/Domain.Tests/LocationTests.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ module Location =
1515

1616
module Series =
1717

18-
let resolve store = Resolver(store, Series.Events.codec, Series.Fold.fold, Series.Fold.initial).Resolve
18+
let resolver store = Resolver(store, Series.Events.codec, Series.Fold.fold, Series.Fold.initial).Resolve
1919

2020
module Epoch =
2121

22-
let resolve store = Resolver(store, Epoch.Events.codec, Epoch.Fold.fold, Epoch.Fold.initial).Resolve
22+
let resolver store = Resolver(store, Epoch.Events.codec, Epoch.Fold.fold, Epoch.Fold.initial).Resolve
2323

2424
let createService (zeroBalance, shouldClose) store =
2525
let maxAttempts = Int32.MaxValue
26-
let series = Series.create (Series.resolve store) maxAttempts
27-
let epochs = Epoch.create (Epoch.resolve store) maxAttempts
26+
let series = Series.create (Series.resolver store) maxAttempts
27+
let epochs = Epoch.create (Epoch.resolver store) maxAttempts
2828
create (zeroBalance, shouldClose) (series, epochs)
2929

3030
let run (service : Location.Service) (IdsAtLeastOne locations, deltas : _[], transactionId) = Async.RunSynchronously <| async {

equinox-fc/Domain/InventoryEpoch.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ type Service internal (resolve : InventoryId * InventoryEpochId -> Equinox.Strea
8282
stream.Transact(decideSync capacity events)
8383

8484
let create resolver =
85-
let resolve locationId =
86-
let stream = resolver (streamName locationId)
85+
let resolve ids =
86+
let stream = resolver (streamName ids)
8787
Equinox.Stream(Serilog.Log.ForContext<Service>(), stream, maxAttempts = 2)
88-
Service (resolve)
88+
Service(resolve)
8989

9090
module Cosmos =
9191

9292
let accessStrategy = Equinox.Cosmos.AccessStrategy.Snapshot (Fold.isOrigin, Fold.snapshot)
93-
let resolve (context, cache) =
93+
let resolver (context, cache) =
9494
let cacheStrategy = Equinox.Cosmos.CachingStrategy.SlidingWindow (cache, System.TimeSpan.FromMinutes 20.)
9595
Equinox.Cosmos.Resolver(context, Events.codec, Fold.fold, Fold.initial, cacheStrategy, accessStrategy).Resolve
96-
let create (context, cache) = create (resolve (context, cache))
96+
let create (context, cache) = create (resolver (context, cache))

equinox-fc/Domain/InventorySeries.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ let create resolver =
4949
module Cosmos =
5050

5151
let accessStrategy = Equinox.Cosmos.AccessStrategy.LatestKnownEvent
52-
let resolve (context, cache) =
52+
let resolver (context, cache) =
5353
let cacheStrategy = Equinox.Cosmos.CachingStrategy.SlidingWindow (cache, System.TimeSpan.FromMinutes 20.)
5454
// For this stream, we uniformly use stale reads as:
5555
// a) we don't require any information from competing writers
5656
// b) while there are competing writers [which might cause us to have to retry a Transact], this should be infrequent
5757
let opt = Equinox.ResolveOption.AllowStale
5858
fun id -> Equinox.Cosmos.Resolver(context, Events.codec, Fold.fold, Fold.initial, cacheStrategy, accessStrategy).Resolve(id, opt)
5959
let create (context, cache) =
60-
create (resolve (context, cache))
60+
create (resolver (context, cache))

equinox-fc/Domain/InventoryTransaction.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ module Cosmos =
148148
let accessStrategy = Equinox.Cosmos.AccessStrategy.Unoptimized
149149
// ... and there will generally be a single actor touching it at a given time, so we don't need to do a load (which would be more expensive than normal given the `accessStrategy`) before we sync
150150
let opt = Equinox.AllowStale
151-
let resolve (context, cache) =
151+
let resolver (context, cache) =
152152
let cacheStrategy = Equinox.Cosmos.CachingStrategy.SlidingWindow (cache, System.TimeSpan.FromMinutes 20.)
153153
fun id -> Equinox.Cosmos.Resolver(context, Events.codec, Fold.fold, Fold.initial, cacheStrategy, accessStrategy).Resolve(id, opt)
154-
let createService (context, cache) = create (resolve (context, cache))
154+
let createService (context, cache) = create (resolver (context, cache))
155155

156156
/// Handles requirement to infer when a transaction is 'stuck'
157157
/// Note we don't want to couple to the state in a deep manner; thus we track:

equinox-fc/Domain/LocationEpoch.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,16 @@ type Service internal (resolve : LocationId * LocationEpochId -> Equinox.Stream<
134134
stream.Transact(sync prevEpochBalanceCarriedForward decide shouldClose)
135135

136136
let create resolver maxAttempts =
137-
let resolve locId =
138-
let stream = resolver (streamName locId)
137+
let resolve locationId =
138+
let stream = resolver (streamName locationId)
139139
Equinox.Stream(Serilog.Log.ForContext<Service>(), stream, maxAttempts = maxAttempts)
140140
Service (resolve)
141141

142142
module Cosmos =
143143

144144
let accessStrategy = Equinox.Cosmos.AccessStrategy.Unoptimized
145-
let resolve (context, cache) =
145+
let resolver (context, cache) =
146146
let cacheStrategy = Equinox.Cosmos.CachingStrategy.SlidingWindow (cache, System.TimeSpan.FromMinutes 20.)
147147
Equinox.Cosmos.Resolver(context, Events.codec, Fold.fold, Fold.initial, cacheStrategy, accessStrategy).Resolve
148148
let create (context, cache, maxAttempts) =
149-
create (resolve (context, cache)) maxAttempts
149+
create (resolver (context, cache)) maxAttempts

equinox-fc/Domain/LocationSeries.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ type Service internal (resolve : LocationId -> Equinox.Stream<Events.Event, Fold
3838
stream.Transact(interpretAdvanceIngestionEpoch epochId)
3939

4040
let create resolver maxAttempts =
41-
let resolve locId =
42-
let stream = resolver (streamName locId)
41+
let resolve locationId =
42+
let stream = resolver (streamName locationId)
4343
Equinox.Stream(Serilog.Log.ForContext<Service>(), stream, maxAttempts = maxAttempts)
4444
Service (resolve)
4545

4646
module Cosmos =
4747

4848
open Equinox.Cosmos
4949

50-
let resolve (context, cache) =
50+
let resolver (context, cache) =
5151
let cacheStrategy = CachingStrategy.SlidingWindow (cache, System.TimeSpan.FromMinutes 20.)
5252
let opt = Equinox.ResolveOption.AllowStale
5353
fun id -> Resolver(context, Events.codec, Fold.fold, Fold.initial, cacheStrategy, AccessStrategy.LatestKnownEvent).Resolve(id, opt)
5454
let createService (context, cache, maxAttempts) =
55-
create (resolve (context, cache)) maxAttempts
55+
create (resolver (context, cache)) maxAttempts

0 commit comments

Comments
 (0)