@@ -11,23 +11,25 @@ type ReadingDirection =
1111
1212module Read =
1313 let readFromStreamAsync : IStreamStore -> ReadingDirection -> StreamDetails -> int -> Async < ReadStreamPage > =
14- fun store direction stream msgCount ->
15- match direction with
16- | Forward -> store.ReadStreamForwards( stream .streamName, stream .position, msgCount)
17- | Backward -> store.ReadStreamBackwards( stream .streamName, stream .position, msgCount)
14+ fun store readingDirection streamDetails msgCount ->
15+ match readingDirection with
16+ | Forward -> store.ReadStreamForwards( streamDetails .streamName, streamDetails .position, msgCount)
17+ | Backward -> store.ReadStreamBackwards( streamDetails .streamName, streamDetails .position, msgCount)
1818 |> Async.AwaitTask
1919
2020 let readFromStreamAsync ' : IStreamStore -> ReadingDirection -> StreamDetails -> int -> CancellationToken -> Async < ReadStreamPage > =
21- fun store direction stream msgCount cancellationToken ->
22- match direction with
23- | Forward -> store.ReadStreamForwards( stream.streamName, stream.position, msgCount, cancellationToken)
24- | Backward -> store.ReadStreamBackwards( stream.streamName, stream.position, msgCount, cancellationToken)
21+ fun store readingDirection streamDetails msgCount cancellationToken ->
22+ match readingDirection with
23+ | Forward ->
24+ store.ReadStreamForwards( streamDetails.streamName, streamDetails.position, msgCount, cancellationToken)
25+ | Backward ->
26+ store.ReadStreamBackwards( streamDetails.streamName, streamDetails.position, msgCount, cancellationToken)
2527 |> Async.AwaitTask
2628
2729module ReadExtras =
2830 let readStreamMessages : IStreamStore -> ReadingDirection -> StreamDetails -> int -> AsyncResult < List < StreamMessage >, string > =
29- fun store direction stream msgCount ->
30- Read.readFromStreamAsync store direction stream msgCount
31+ fun store readingDirection streamDetails msgCount ->
32+ Read.readFromStreamAsync store readingDirection streamDetails msgCount
3133 |> Async.bind ( fun readStreamPage ->
3234 readStreamPage.Messages
3335 |> Seq.toList
0 commit comments