コード例 #1
0
 public static async Task <long> CommitMarkedIgnoringDisposedAsync(this IMessageBatch batch, CancellationToken cancellationToken)
 {
     try {
         return(await batch.CommitMarkedAsync(cancellationToken));
     } catch (ObjectDisposedException) {
         // ignore
         return(0);
     }
 }
コード例 #2
0
        public static Task CommitAsync(this IMessageBatch batch, Message message, CancellationToken cancellationToken)
        {
            if (message == null)
            {
                return(Task.FromResult(0));
            }

            batch.MarkSuccessful(message);
            return(batch.CommitMarkedAsync(cancellationToken));
        }