@@ -24,6 +24,8 @@ module ReadRaw =
24
24
| StartPosition.Any -> - 1 L
25
25
| StartPosition.SpecificPosition position -> position
26
26
27
+ /// Read forwards from the all stream.
28
+ /// Can throw exceptions.
27
29
let allForwards ( store : SqlStreamStore.IStreamStore )
28
30
( startPositionInclusive : StartPosition )
29
31
( msgCount : int )
@@ -33,6 +35,8 @@ module ReadRaw =
33
35
|> Async.awaitTaskWithInnerException
34
36
}
35
37
38
+ /// Read backwards from the all stream.
39
+ /// Can throw exceptions.
36
40
let allBackwards ( store : SqlStreamStore.IStreamStore )
37
41
( startPositionInclusive : StartPosition )
38
42
( msgCount : int )
@@ -42,6 +46,8 @@ module ReadRaw =
42
46
|> Async.awaitTaskWithInnerException
43
47
}
44
48
49
+ /// Read forwards from a specific stream.
50
+ /// Can throw exceptions.
45
51
let streamForwards ( store : SqlStreamStore.IStreamStore )
46
52
( streamName : string )
47
53
( readVersion : ReadVersion )
@@ -52,6 +58,8 @@ module ReadRaw =
52
58
|> Async.awaitTaskWithInnerException
53
59
}
54
60
61
+ /// Read backwards from a specific stream.
62
+ /// Can throw exceptions.
55
63
let streamBackwards ( store : SqlStreamStore.IStreamStore )
56
64
( streamName : string )
57
65
( readVersion : ReadVersion )
@@ -62,6 +70,8 @@ module ReadRaw =
62
70
|> Async.awaitTaskWithInnerException
63
71
}
64
72
73
+ /// Read forwards from the all stream, prefetching the messages' jsonData.
74
+ /// Can throw exceptions.
65
75
let allForwardsPrefetch ( store : SqlStreamStore.IStreamStore )
66
76
( startPositionInclusive : StartPosition )
67
77
( msgCount : int )
@@ -73,6 +83,8 @@ module ReadRaw =
73
83
|> Async.awaitTaskWithInnerException
74
84
}
75
85
86
+ /// Read backwards from the all stream, prefetching the messages' jsonData.
87
+ /// Can throw exceptions.
76
88
let allBackwardsPrefetch ( store : SqlStreamStore.IStreamStore )
77
89
( startPositionInclusive : StartPosition )
78
90
( msgCount : int )
@@ -84,6 +96,8 @@ module ReadRaw =
84
96
|> Async.awaitTaskWithInnerException
85
97
}
86
98
99
+ /// Read forwards from a specific stream, prefetching the messages' jsonData.
100
+ /// Can throw exceptions.
87
101
let streamForwardsPrefetch ( store : SqlStreamStore.IStreamStore )
88
102
( streamName : string )
89
103
( readVersion : ReadVersion )
@@ -96,6 +110,8 @@ module ReadRaw =
96
110
|> Async.awaitTaskWithInnerException
97
111
}
98
112
113
+ /// Read backwards from a specific stream, prefetching the messages' jsonData.
114
+ /// Can throw exceptions.
99
115
let streamBackwardsPrefetch ( store : SqlStreamStore.IStreamStore )
100
116
( streamName : string )
101
117
( readVersion : ReadVersion )
@@ -108,12 +124,15 @@ module ReadRaw =
108
124
|> Async.awaitTaskWithInnerException
109
125
}
110
126
111
- let allForwards ' ( store : SqlStreamStore.IStreamStore )
112
- ( startPositionInclusive : StartPosition )
113
- ( msgCount : int )
114
- ( prefetchJson : bool )
115
- ( cancellationToken : CancellationToken )
116
- : Async < ReadAllPage > =
127
+ /// Read forwards from the all stream, prefetching the messages' jsonData.
128
+ /// Needs a cancellation token.
129
+ /// Can throw exceptions.
130
+ let allForwardsPrefetchWithCancellation ( store : SqlStreamStore.IStreamStore )
131
+ ( startPositionInclusive : StartPosition )
132
+ ( msgCount : int )
133
+ ( prefetchJson : bool )
134
+ ( cancellationToken : CancellationToken )
135
+ : Async < ReadAllPage > =
117
136
async {
118
137
return ! store.ReadAllForwards
119
138
( fromStartPositionInclusiveForwards startPositionInclusive,
@@ -123,51 +142,46 @@ module ReadRaw =
123
142
|> Async.awaitTaskWithInnerException
124
143
}
125
144
126
- let allBackwards ' ( store : SqlStreamStore.IStreamStore )
127
- ( startPositionInclusive : StartPosition )
128
- ( msgCount : int )
129
- ( prefetchJson : bool )
130
- ( cancellationToken : CancellationToken )
131
- : Async < ReadAllPage > =
145
+ /// Read forwards from the all stream, prefetching the messages' jsonData.
146
+ /// Needs a cancellation token.
147
+ /// Can throw exceptions.
148
+ let allBackwardsPrefetchWithCancellation ( store : SqlStreamStore.IStreamStore )
149
+ ( startPositionInclusive : StartPosition )
150
+ ( msgCount : int )
151
+ ( cancellationToken : CancellationToken )
152
+ : Async < ReadAllPage > =
132
153
async {
133
154
return ! store.ReadAllBackwards
134
- ( fromStartPositionInclusiveBackwards startPositionInclusive,
135
- msgCount,
136
- prefetchJson,
137
- cancellationToken)
155
+ ( fromStartPositionInclusiveBackwards startPositionInclusive, msgCount, true , cancellationToken)
138
156
|> Async.awaitTaskWithInnerException
139
157
}
140
158
141
- let streamForwards ' ( store : SqlStreamStore.IStreamStore )
142
- ( streamName : string )
143
- ( readVersion : ReadVersion )
144
- ( msgCount : int )
145
- ( prefetchJson : bool )
146
- ( cancellationToken : CancellationToken )
147
- : Async < ReadStreamPage > =
159
+ /// Read forwards from a specific stream, prefetching the messages' jsonData.
160
+ /// Needs a cancellation token.
161
+ /// Can throw exceptions.
162
+ let streamForwardsPrefetchWithCancellation ( store : SqlStreamStore.IStreamStore )
163
+ ( streamName : string )
164
+ ( readVersion : ReadVersion )
165
+ ( msgCount : int )
166
+ ( cancellationToken : CancellationToken )
167
+ : Async < ReadStreamPage > =
148
168
async {
149
169
return ! store.ReadStreamForwards
150
- ( StreamId( streamName),
151
- fromReadVersionForwards readVersion,
152
- msgCount,
153
- prefetchJson,
154
- cancellationToken)
170
+ ( StreamId( streamName), fromReadVersionForwards readVersion, msgCount, true , cancellationToken)
155
171
|> Async.awaitTaskWithInnerException
156
172
}
157
173
158
- let streamBackwards ' ( store : SqlStreamStore.IStreamStore )
159
- ( streamName : string )
160
- ( readVersion : ReadVersion )
161
- ( msgCount : int )
162
- ( prefetchJson : bool )
163
- ( cancellationToken : CancellationToken )
164
- : Async < ReadStreamPage > =
174
+ /// Read backwards from a specific stream, prefetching the messages' jsonData.
175
+ /// Needs a cancellation token.
176
+ /// Can throw exceptions.
177
+ let streamBackwardsPrefetchWithCancellation ( store : SqlStreamStore.IStreamStore )
178
+ ( streamName : string )
179
+ ( readVersion : ReadVersion )
180
+ ( msgCount : int )
181
+ ( cancellationToken : CancellationToken )
182
+ : Async < ReadStreamPage > =
165
183
async {
166
184
return ! store.ReadStreamBackwards
167
- ( StreamId( streamName),
168
- fromReadVersionBackwards readVersion,
169
- msgCount,
170
- prefetchJson,
171
- cancellationToken)
185
+ ( StreamId( streamName), fromReadVersionBackwards readVersion, msgCount, true , cancellationToken)
172
186
|> Async.awaitTaskWithInnerException
173
187
}
0 commit comments