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