File tree Expand file tree Collapse file tree 2 files changed +1
-46
lines changed Expand file tree Collapse file tree 2 files changed +1
-46
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ module Append =
2222 | AppendVersion.EmptyStream -> SqlStreamStore.Streams.ExpectedVersion.EmptyStream
2323 | AppendVersion.NoStream -> SqlStreamStore.Streams.ExpectedVersion.NoStream
2424 | AppendVersion.SpecificVersion version -> version
25-
25+
2626 let appendNewMessage : SqlStreamStore.IStreamStore -> AppendStreamDetails -> MessageDetails -> Async < AppendResult > =
2727 fun store streamDetails messageDetails ->
2828 store.AppendToStream
@@ -40,19 +40,3 @@ module Append =
4040 |> List.map newStreamMessageFromMessageDetails
4141 |> List.toArray)
4242 |> Async.AwaitTask
43-
44- module AppendExtras =
45- let appendNewMessage : SqlStreamStore.IStreamStore -> AppendStreamDetails -> MessageDetails -> AsyncResult < AppendResult , AppendException > =
46- fun store streamDetails messageDetails ->
47- Append.appendNewMessage store streamDetails messageDetails
48- |> Async.Catch
49- |> Async.map ( function
50- | Choice1Of2 response -> Ok response
51- | Choice2Of2 exn ->
52- Error
53- <| match exn with
54- // TODO: make sense
55- | :? System.AggregateException as exn ->
56- exn.InnerException
57- |> AppendException.WrongExpectedVersion
58- | exn -> exn |> AppendException.Other)
Original file line number Diff line number Diff line change @@ -52,32 +52,3 @@ module Read =
5252 prefetchJson,
5353 cancellationToken)
5454 |> Async.AwaitTask
55-
56- module ReadExtras =
57- let readAllStreamMessages : SqlStreamStore.IStreamStore -> ReadingDirection -> StartPositionInclusive -> MessageCount -> AsyncResult < List < StreamMessage >, string > =
58- fun store readingDirection startPositionInclusive msgCount ->
59- Read.readFromAllStreamAsync store readingDirection startPositionInclusive msgCount
60- |> Async.bind ( fun readAllPage ->
61- readAllPage.Messages
62- |> Seq.toList
63- |> fun messageList ->
64- if messageList.Length = msgCount then
65- Ok messageList
66- else
67- Error
68- ( sprintf " Failed to retrieve all messages. Retrieved messages count: %d " messageList.Length)
69- |> AsyncResult.fromResult)
70-
71- let readStreamMessages : SqlStreamStore.IStreamStore -> ReadingDirection -> ReadStreamDetails -> MessageCount -> AsyncResult < List < StreamMessage >, string > =
72- fun store readingDirection readStreamDetails msgCount ->
73- Read.readFromStreamAsync store readingDirection readStreamDetails msgCount
74- |> Async.bind ( fun readStreamPage ->
75- readStreamPage.Messages
76- |> Seq.toList
77- |> fun messageList ->
78- if messageList.Length = msgCount then
79- Ok messageList
80- else
81- Error
82- ( sprintf " Failed to retrieve all messages. Retrieved messages count: %d " messageList.Length)
83- |> AsyncResult.fromResult)
You can’t perform that action at this time.
0 commit comments