@@ -135,7 +135,9 @@ public async Task<IAsyncDisposable> SubscribeEventHandlerPersistently<TEventHand
135
135
IEnumerable < string > ? events ,
136
136
TEventHandler ? model ,
137
137
string ? outputStream = null , string ? groupName = null , IPosition ? startFrom = null ,
138
- bool ensureOutputStreamProjection = true , CancellationToken token = default )
138
+ bool ensureOutputStreamProjection = true ,
139
+ int minCheckpointCount = 1 ,
140
+ CancellationToken token = default )
139
141
where TEventHandler : class , IEventHandler
140
142
{
141
143
var handlerType = typeof ( TEventHandler ) ;
@@ -152,7 +154,7 @@ public async Task<IAsyncDisposable> SubscribeEventHandlerPersistently<TEventHand
152
154
catch ( PersistentSubscriptionNotFoundException )
153
155
{
154
156
await PersistentSubscriptionClient . CreateToStreamAsync ( outputStream , groupName ,
155
- new PersistentSubscriptionSettings ( true , startFrom ) , cancellationToken : token ) ;
157
+ new PersistentSubscriptionSettings ( true , startFrom , checkPointLowerBound : minCheckpointCount ) , cancellationToken : token ) ;
156
158
}
157
159
158
160
var sub = SubscribePersistently ( outputStream , groupName , cancellationToken : token ) ;
@@ -166,20 +168,20 @@ await PersistentSubscriptionClient.CreateToStreamAsync(outputStream, groupName,
166
168
167
169
public Task < IAsyncDisposable > SubscribeEventHandlerPersistently < TEventHandler > ( TEventHandler ? model ,
168
170
string ? outputStream = null , string ? groupName = null , IPosition ? startFrom = null ,
169
- bool ensureOutputStreamProjection = true , CancellationToken token = default )
171
+ bool ensureOutputStreamProjection = true , int minCheckPointCount = 1 , CancellationToken token = default )
170
172
where TEventHandler : class , IEventHandler , ITypeRegister
171
173
{
172
174
return SubscribeEventHandlerPersistently ( _typeHandlerRegisters . GetEventNameConverterFor < TEventHandler > ( ) ,
173
175
_typeHandlerRegisters . GetEventNamesFor < TEventHandler > ( ) ,
174
- model , outputStream , groupName , startFrom , ensureOutputStreamProjection , token ) ;
176
+ model , outputStream , groupName , startFrom , ensureOutputStreamProjection , minCheckPointCount , token ) ;
175
177
}
176
178
177
179
178
- public ISubscriptionRunner SubscribePersistently ( string streamName , string groupName , int bufferSize = 10 ,
180
+ public ISubscriptionRunner SubscribePersistently ( string streamName , string groupName , int bufferSize = 10 ,
179
181
UserCredentials ? userCredentials = null , CancellationToken cancellationToken = default )
180
182
{
181
183
return new PersistentSubscriptionRunner ( this ,
182
- PersistentSubscriptionClient . SubscribeToStream ( streamName , groupName , bufferSize , userCredentials ,
184
+ PersistentSubscriptionClient . SubscribeToStream ( streamName , groupName , bufferSize , userCredentials ,
183
185
cancellationToken ) ) ;
184
186
}
185
187
0 commit comments