Skip to content

Commit

Permalink
Formatting consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Feb 13, 2020
1 parent d42a1b8 commit d539822
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion equinox-fc/Domain.Tests/AllocationTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ open FsCheck.Xunit
open Swensen.Unquote

let [<Property>] ``codec can roundtrip`` event =
let ee = Events.codec.Encode(None,event)
let ee = Events.codec.Encode(None, event)
let ie = FsCodec.Core.TimelineEvent.Create(0L, ee.EventType, ee.Data)
test <@ Some event = Events.codec.TryDecode ie @>
2 changes: 1 addition & 1 deletion equinox-fc/Domain.Tests/Infrastructure.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module Cosmos =
let context = Context(connection, d, c)
let cache = Equinox.Cache (appName, 10)
context, cache
| s,d,c ->
| s, d, c ->
failwithf "Connection, Database and Container EQUINOX_COSMOS_* Environment variables are required (%b,%b,%b)"
(Option.isSome s) (Option.isSome d) (Option.isSome c)

Expand Down
2 changes: 1 addition & 1 deletion equinox-fc/Domain.Tests/LocationSeriesTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ let [<Property>] properties c1 c2 =
test <@ List.isEmpty l @>

let [<Property>] ``codec can roundtrip`` event =
let ee = Events.codec.Encode(None,event)
let ee = Events.codec.Encode(None, event)
let ie = FsCodec.Core.TimelineEvent.Create(0L, ee.EventType, ee.Data)
test <@ Some event = Events.codec.TryDecode ie @>
6 changes: 3 additions & 3 deletions equinox-fc/Domain/Allocation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module Events =
interface TypeShape.UnionContract.IUnionContract
let codec = FsCodec.NewtonsoftJson.Codec.Create<Event>()
let [<Literal>] categoryId = "Allocation"
let (|AggregateId|) id = Equinox.AggregateId(categoryId, AllocationId.toString id)
let (|For|) id = Equinox.AggregateId(categoryId, AllocationId.toString id)

module Fold =

Expand Down Expand Up @@ -216,9 +216,9 @@ let sync (updates : Update seq, command : Command) (state : Fold.State) : (bool*
(* Yield outstanding processing requirements (if any), together with events accumulated based on the `updates` *)
(accepted, ProcessState.FromFoldState state), acc.Accumulated

type Service internal (log, resolve, ?maxAttempts) =
type Service internal (log, resolve, maxAttempts) =

let resolve (Events.AggregateId id) = Equinox.Stream<Events.Event, Fold.State>(log, resolve id, maxAttempts = defaultArg maxAttempts 3)
let resolve (Events.For id) = Equinox.Stream<Events.Event, Fold.State>(log, resolve id, maxAttempts)

member __.Sync(allocationId, updates, command) : Async<bool*ProcessState> =
let stream = resolve allocationId
Expand Down
8 changes: 4 additions & 4 deletions equinox-fc/Domain/ListAllocation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ type Service(maxListLen, allocators : Allocator.Service, allocations : Allocatio
let cutoff = let now = DateTimeOffset.UtcNow in now.Add transactionTimeout
let! state = allocators.Commence(allocatorId, allocationId, cutoff)
// TODO cancel timed out conflicting work
let! (_,state) = allocations.Sync(allocationId, Seq.empty, Allocation.Commence tickets)
let! _, state = allocations.Sync(allocationId, Seq.empty, Allocation.Commence tickets)
return state }

member __.Read(allocationId) : Async<_> = async {
let! (_,state) = allocations.Sync(allocationId, Seq.empty, Allocation.Command.Apply ([],[]))
let! _, state = allocations.Sync(allocationId, Seq.empty, Allocation.Command.Apply ([], []))
// TODO incorporate allocator state
return state }

member __.Cancel(allocatorId,allocationId) : Async<_> = async {
let! (_,state) = allocations.Sync(allocationId, Seq.empty, Allocation.Command.Cancel)
member __.Cancel(allocatorId, allocationId) : Async<_> = async {
let! _, state = allocations.Sync(allocationId, Seq.empty, Allocation.Command.Cancel)
// TODO propagate to allocator with reason
return state }
4 changes: 2 additions & 2 deletions equinox-fc/Domain/TicketList.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Events =
interface TypeShape.UnionContract.IUnionContract
let codec = FsCodec.NewtonsoftJson.Codec.Create<Event>()
let [<Literal>] categoryId = "TicketList"
let (|AggregateId|) id = Equinox.AggregateId(categoryId, TicketListId.toString id)
let (|For|) id = Equinox.AggregateId(categoryId, TicketListId.toString id)

module Fold =

Expand All @@ -31,7 +31,7 @@ let interpret (allocatorId : AllocatorId, allocated : TicketId list) (state : Fo

type Service internal (log, resolve, maxAttempts) =

let resolve (Events.AggregateId id) = Equinox.Stream<Events.Event, Fold.State>(log, resolve id, maxAttempts)
let resolve (Events.For id) = Equinox.Stream<Events.Event, Fold.State>(log, resolve id, maxAttempts)

member __.Sync(pickListId, allocatorId, assignedTickets) : Async<unit> =
let stream = resolve pickListId
Expand Down

0 comments on commit d539822

Please sign in to comment.