Skip to content

Commit

Permalink
Tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Nov 23, 2018
1 parent a9ff593 commit 277e470
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
8 changes: 4 additions & 4 deletions samples/Store/Integration/ContactPreferencesIntegration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ let resolveStreamGesWithCompactionSemantics gateway =
let resolveStreamGesWithoutCompactionSemantics gateway =
GesStreamBuilder(gateway defaultBatchSize, codec, fold, initial).Create

let resolveStreamEqxWithCompactionSemantics gateway =
let resolveStreamEqxWithKnownEventTypeSemantics gateway =
EqxStreamBuilder(gateway 1, codec, fold, initial, AccessStrategy.AnyKnownEventType Domain.ContactPreferences.Events.eventTypeNames).Create
let resolveStreamEqxWithoutCompactionSemantics gateway =
let resolveStreamEqxWithoutCustomAccessStrategy gateway =
EqxStreamBuilder(gateway defaultBatchSize, codec, fold, initial).Create

type Tests(testOutputHelper) =
Expand Down Expand Up @@ -63,12 +63,12 @@ type Tests(testOutputHelper) =

[<AutoData(SkipIfRequestedViaEnvironmentVariable="EQUINOX_INTEGRATION_SKIP_COSMOS")>]
let ``Can roundtrip against Cosmos, correctly folding the events with normal semantics`` args = Async.RunSynchronously <| async {
let! service = arrange connectToSpecifiedCosmosOrSimulator createEqxStore resolveStreamEqxWithoutCompactionSemantics
let! service = arrange connectToSpecifiedCosmosOrSimulator createEqxStore resolveStreamEqxWithoutCustomAccessStrategy
do! act service args
}

[<AutoData(SkipIfRequestedViaEnvironmentVariable="EQUINOX_INTEGRATION_SKIP_COSMOS")>]
let ``Can roundtrip against Cosmos, correctly folding the events with compaction semantics`` args = Async.RunSynchronously <| async {
let! service = arrange connectToSpecifiedCosmosOrSimulator createEqxStore resolveStreamEqxWithCompactionSemantics
let! service = arrange connectToSpecifiedCosmosOrSimulator createEqxStore resolveStreamEqxWithKnownEventTypeSemantics
do! act service args
}
6 changes: 2 additions & 4 deletions src/Equinox.Cosmos/Cosmos.fs
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,6 @@ type EqxConnection(client: IDocumentClient, ?readRetryPolicy (*: (int -> Async<'
member __.Client = client
member __.ReadRetryPolicy = readRetryPolicy
member __.WriteRetryPolicy = writeRetryPolicy
//member __.Close = (client :?> Client.DocumentClient).Dispose()

/// Defines the policies in force regarding how to constrain query responses
type EqxBatchingPolicy
Expand Down Expand Up @@ -1041,7 +1040,6 @@ open Equinox.Cosmos
open Equinox.Cosmos.Builder
open Equinox.Cosmos.Events
open FSharp.Control
open Equinox

/// Outcome of appending events, specifying the new and/or conflicting events, together with the updated Target write position
[<RequireQualifiedAccess; NoComparison>]
Expand Down Expand Up @@ -1151,12 +1149,12 @@ module Events =
| int64.MaxValue -> None
| i -> Some (Position.FromI (i + 1L))

/// Returns an aFromLastIndexs in the stream starting at the specified sequence number,
/// Returns an async sequence of events in the stream starting at the specified sequence number,
/// reading in batches of the specified size.
/// Returns an empty sequence if the stream is empty or if the sequence number is larger than the largest
/// sequence number in the stream.
let getAll (ctx: EqxContext) (streamName: string) (MinPosition index: int64) (batchSize: int): AsyncSeq<IOrderedEvent[]> =
ctx.Walk(ctx.CreateStream streamName, batchSize,?position=index)
ctx.Walk(ctx.CreateStream streamName, batchSize, ?position=index)

/// Returns an async array of events in the stream starting at the specified sequence number,
/// number of events to read is specified by batchSize
Expand Down
4 changes: 2 additions & 2 deletions tests/Equinox.Cosmos.Integration/CosmosCoreIntegration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ open System.Text

#nowarn "1182" // From hereon in, we may have some 'unused' privates (the tests)

type EventData = { eventType: string; data: byte[] } with
type EventData = { eventType:string; data: byte[] } with
interface Events.IEvent with
member __.EventType = __.eventType
member __.Data = __.data
Expand Down Expand Up @@ -56,7 +56,7 @@ type Tests(testOutputHelper) =
test <@ AppendResult.Ok 6L = res @>
test <@ [EqxAct.Append] = capture.ExternalCalls @>
// We didnt request small batches or splitting so it's not dramatically more expensive to write N events
verifyRequestChargesMax 30 // observed 26.62 was 11
verifyRequestChargesMax 11
}

let blobEquals (x: byte[]) (y: byte[]) = System.Linq.Enumerable.SequenceEqual(x,y)
Expand Down

0 comments on commit 277e470

Please sign in to comment.