@@ -175,15 +175,13 @@ public void Ack()
175
175
}
176
176
177
177
///<summary>If we are not in "noAck" mode, calls
178
- ///IModel.BasicAck with the delivery-tag from the passed in
179
- ///event; otherwise, sends nothing to the server. In both
180
- ///cases, if the passed-in event is the same as LatestEvent
181
- ///(by pointer comparison), sets LatestEvent to
182
- ///null.</summary>
178
+ ///IModel.BasicAck with the delivery-tag from <paramref name="evt"/>;
179
+ ///otherwise, sends nothing to the server. if <paramref name="evt"/> is the same as LatestEvent
180
+ ///by pointer comparison, sets LatestEvent to null.
181
+ ///</summary>
183
182
///<remarks>
184
- /// Make sure that this method is only called with events that
185
- /// originated from this Subscription - other usage will have
186
- /// unpredictable results.
183
+ ///Passing an event that did not originate with this Subscription's
184
+ /// channel, will lead to unpredictable behaviour
187
185
///</remarks>
188
186
public void Ack ( BasicDeliverEventArgs evt )
189
187
{
@@ -200,6 +198,53 @@ public void Ack(BasicDeliverEventArgs evt)
200
198
}
201
199
}
202
200
201
+ ///<summary>If LatestEvent is non-null, passes it to
202
+ ///Nack(BasicDeliverEventArgs, false, requeue). Causes LatestEvent to become
203
+ ///null.</summary>
204
+ public void Nack ( bool requeue )
205
+ {
206
+ if ( m_latestEvent != null ) {
207
+ Nack ( m_latestEvent , false , requeue ) ;
208
+ }
209
+ }
210
+
211
+
212
+ ///<summary>If LatestEvent is non-null, passes it to
213
+ ///Nack(BasicDeliverEventArgs, multiple, requeue). Causes LatestEvent to become
214
+ ///null.</summary>
215
+ public void Nack ( bool multiple , bool requeue )
216
+ {
217
+ if ( m_latestEvent != null ) {
218
+ Nack ( m_latestEvent , multiple , requeue ) ;
219
+ }
220
+ }
221
+
222
+ ///<summary>If we are not in "noAck" mode, calls
223
+ ///IModel.BasicNack with the delivery-tag from <paramref name="evt"/>;
224
+ ///otherwise, sends nothing to the server. if <paramref name="evt"/> is the same as LatestEvent
225
+ ///by pointer comparison, sets LatestEvent to null.
226
+ ///</summary>
227
+ ///<remarks>
228
+ ///Passing an event that did not originate with this Subscription's
229
+ /// channel, will lead to unpredictable behaviour
230
+ ///</remarks>
231
+ public void Nack ( BasicDeliverEventArgs evt ,
232
+ bool multiple ,
233
+ bool requeue )
234
+ {
235
+ if ( evt == null ) {
236
+ return ;
237
+ }
238
+
239
+ if ( ! m_noAck ) {
240
+ m_model . BasicNack ( evt . DeliveryTag , multiple , requeue ) ;
241
+ }
242
+
243
+ if ( evt == m_latestEvent ) {
244
+ m_latestEvent = null ;
245
+ }
246
+ }
247
+
203
248
///<summary>Retrieves the next incoming delivery in our
204
249
///subscription queue.</summary>
205
250
///<remarks>
0 commit comments