コード例 #1
0
 /// <summary>
 /// Clears the expired messages from the queue
 /// </summary>
 /// <param name="cancelToken">The cancel token. When signaled, processing should stop as soon as possible</param>
 /// <returns></returns>
 public long ClearMessages(CancellationToken cancelToken)
 {
     using (_timer.NewContext())
     {
         var count = _handler.ClearMessages(cancelToken);
         _counter.Increment(count);
         return(count);
     }
 }
コード例 #2
0
        /// <summary>
        /// Clears the expired messages from the queue
        /// </summary>
        /// <param name="cancelToken">The cancel token. When signaled, processing should stop as soon as possible</param>
        /// <returns></returns>
        public long ClearMessages(CancellationToken cancelToken)
        {
            var count = _handler.ClearMessages(cancelToken);

            if (count > 0)
            {
                _log.LogInformation($"Deleted {count} expired messages from {_connectionInfo.QueueName}");
            }
            return(count);
        }