| | 1 | | // Copyright (c) Microsoft. All rights reserved. |
| | 2 | | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
| | 3 | |
|
| | 4 | | namespace Microsoft.Azure.ServiceBus |
| | 5 | | { |
| | 6 | | using System; |
| | 7 | |
|
| | 8 | | /// <summary> |
| | 9 | | /// A retry policy, which does not actually retry. |
| | 10 | | /// </summary> |
| | 11 | | /// <remarks>Use this if you want all Service Bus exceptions to be handled by user code.</remarks> |
| | 12 | | public sealed class NoRetry : RetryPolicy |
| | 13 | | { |
| | 14 | | /// <summary> |
| | 15 | | /// Called to see if a retry should be performed. |
| | 16 | | /// </summary> |
| | 17 | | /// <param name="remainingTime">The remaining time before the timeout expires.</param> |
| | 18 | | /// <param name="currentRetryCount">The number of attempts that have been processed.</param> |
| | 19 | | /// <param name="retryInterval">The amount of time to delay before retry.</param> |
| | 20 | | protected override bool OnShouldRetry( |
| | 21 | | TimeSpan remainingTime, |
| | 22 | | int currentRetryCount, |
| | 23 | | out TimeSpan retryInterval) |
| | 24 | | { |
| 0 | 25 | | retryInterval = TimeSpan.Zero; |
| 0 | 26 | | return false; |
| | 27 | | } |
| | 28 | | } |
| | 29 | | } |