Skip to content

Commit 0db2086

Browse files
Rename to DelayStrategy (Azure#35434)
* Rename to DelayStrategy * Rename
1 parent af08a03 commit 0db2086

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+95
-97
lines changed

eng/Directory.Build.Common.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
<Compile Include="$(AzureCoreSharedSources)OperationInternal.cs" LinkBase="Shared/Core" />
197197
<Compile Include="$(AzureCoreSharedSources)OperationInternalBase.cs" LinkBase="Shared/Core" />
198198
<Compile Include="$(AzureCoreSharedSources)OperationInternalOfT.cs" LinkBase="Shared/Core" />
199-
<Compile Include="$(AzureCoreSharedSources)DelayStrategy.cs" LinkBase="Shared/Core" />
199+
<Compile Include="$(AzureCoreSharedSources)DelayStrategyInternal.cs" LinkBase="Shared/Core" />
200200
<Compile Include="$(AzureCoreSharedSources)ConstantDelayStrategy.cs" LinkBase="Shared/Core" />
201201
<Compile Include="$(AzureCoreSharedSources)ExponentialDelayStrategy.cs" LinkBase="Shared/Core" />
202202
<Compile Include="$(AzureCoreSharedSources)RetryAfterDelayStrategy.cs" LinkBase="Shared/Core" />

sdk/core/Azure.Core.TestFramework/src/Instrumentation/ZeroPollingStrategy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
namespace Azure.Core
99
{
1010
/// <summary>
11-
/// Implementation of a <see cref="DelayStrategy"/> with 0 interval.
11+
/// Implementation of a <see cref="DelayStrategyInternal"/> with 0 interval.
1212
/// This is normally used for testing, like record playback.
1313
/// </summary>
14-
internal class ZeroPollingStrategy : DelayStrategy
14+
internal class ZeroPollingStrategy : DelayStrategyInternal
1515
{
1616
public override TimeSpan GetNextDelay(Response response, TimeSpan? suggestedInterval) => TimeSpan.Zero;
1717
}

sdk/core/Azure.Core.TestFramework/src/Shared/MockOperation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public MockOperation(
2424
string operationTypeName = null,
2525
IEnumerable<KeyValuePair<string, string>> scopeAttributes = null,
2626
int? callsToComplete = null,
27-
DelayStrategy fallbackStrategy = null,
27+
DelayStrategyInternal fallbackStrategy = null,
2828
bool exceptionOnWait = false,
2929
Exception customExceptionOnUpdate = null,
3030
RequestFailedException originalExceptionOnUpdate = null)

sdk/core/Azure.Core.TestFramework/src/Shared/MockOperationInternal.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public MockOperationInternal(
1616
Func<MockResponse> responseFactory,
1717
string operationTypeName,
1818
IEnumerable<KeyValuePair<string, string>> scopeAttributes,
19-
DelayStrategy pollingStrategy)
19+
DelayStrategyInternal pollingStrategy)
2020
: base(clientDiagnostics, operation, responseFactory(), operationTypeName, scopeAttributes, pollingStrategy)
2121
{ }
2222

sdk/core/Azure.Core.TestFramework/src/Shared/MockOperationInternalOfT.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public MockOperationInternal(
1818
Func<MockResponse> responseFactory,
1919
string operationTypeName,
2020
IEnumerable<KeyValuePair<string, string>> scopeAttributes,
21-
DelayStrategy pollingStrategy)
21+
DelayStrategyInternal pollingStrategy)
2222
: base(clientDiagnostics, operation, responseFactory(), operationTypeName, scopeAttributes, pollingStrategy)
2323
{ }
2424

sdk/core/Azure.Core.TestFramework/src/Shared/MockOperationOfT.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public MockOperation(
2929
string operationTypeName = null,
3030
IEnumerable<KeyValuePair<string, string>> scopeAttributes = null,
3131
int? callsToComplete = null,
32-
DelayStrategy fallbackStrategy = null,
32+
DelayStrategyInternal fallbackStrategy = null,
3333
bool exceptionOnWait = false,
3434
Exception customExceptionOnUpdate = null,
3535
RequestFailedException originalExceptionOnUpdate = null)

sdk/core/Azure.Core/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- Set the Activity status to `Error` on failed activity source activities.
1515
- Mark the `Azure.Core.Http.Request` span as failed if the request fails with an exception thrown in the pipeline.
1616
- Fixed equality comparison when comparing a `string` to a `ContentType` instance.
17+
- Jitter is added when using a `RetryMode` of `Fixed`.
1718

1819
### Other Changes
1920

sdk/core/Azure.Core/api/Azure.Core.net461.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,11 @@ public void AddPolicy(Azure.Core.Pipeline.HttpPipelinePolicy policy, Azure.Core.
398398
public static bool operator !=(Azure.Core.ContentType left, Azure.Core.ContentType right) { throw null; }
399399
public override string ToString() { throw null; }
400400
}
401-
public abstract partial class Delay
401+
public abstract partial class DelayStrategy
402402
{
403-
protected Delay(System.TimeSpan? maxDelay = default(System.TimeSpan?), double jitterFactor = 0.2) { }
404-
public static Azure.Core.Delay CreateExponentialDelay(System.TimeSpan? initialDelay = default(System.TimeSpan?), System.TimeSpan? maxDelay = default(System.TimeSpan?)) { throw null; }
405-
public static Azure.Core.Delay CreateFixedDelay(System.TimeSpan? delay = default(System.TimeSpan?)) { throw null; }
403+
protected DelayStrategy(System.TimeSpan? maxDelay = default(System.TimeSpan?), double jitterFactor = 0.2) { }
404+
public static Azure.Core.DelayStrategy CreateExponentialDelayStrategy(System.TimeSpan? initialDelay = default(System.TimeSpan?), System.TimeSpan? maxDelay = default(System.TimeSpan?)) { throw null; }
405+
public static Azure.Core.DelayStrategy CreateFixedDelayStrategy(System.TimeSpan? delay = default(System.TimeSpan?)) { throw null; }
406406
public System.TimeSpan GetNextDelay(Azure.Response? response, int retryNumber) { throw null; }
407407
protected abstract System.TimeSpan GetNextDelayCore(Azure.Response? response, int retryNumber);
408408
protected static System.TimeSpan Max(System.TimeSpan val1, System.TimeSpan val2) { throw null; }
@@ -1035,7 +1035,7 @@ public static void SetAllowAutoRedirect(Azure.Core.HttpMessage message, bool all
10351035
}
10361036
public partial class RetryPolicy : Azure.Core.Pipeline.HttpPipelinePolicy
10371037
{
1038-
public RetryPolicy(int maxRetries = 3, Azure.Core.Delay? delay = null) { }
1038+
public RetryPolicy(int maxRetries = 3, Azure.Core.DelayStrategy? delayStrategy = null) { }
10391039
protected internal virtual void OnRequestSent(Azure.Core.HttpMessage message) { }
10401040
protected internal virtual System.Threading.Tasks.ValueTask OnRequestSentAsync(Azure.Core.HttpMessage message) { throw null; }
10411041
protected internal virtual void OnSendingRequest(Azure.Core.HttpMessage message) { }

sdk/core/Azure.Core/api/Azure.Core.net5.0.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,11 @@ public void AddPolicy(Azure.Core.Pipeline.HttpPipelinePolicy policy, Azure.Core.
398398
public static bool operator !=(Azure.Core.ContentType left, Azure.Core.ContentType right) { throw null; }
399399
public override string ToString() { throw null; }
400400
}
401-
public abstract partial class Delay
401+
public abstract partial class DelayStrategy
402402
{
403-
protected Delay(System.TimeSpan? maxDelay = default(System.TimeSpan?), double jitterFactor = 0.2) { }
404-
public static Azure.Core.Delay CreateExponentialDelay(System.TimeSpan? initialDelay = default(System.TimeSpan?), System.TimeSpan? maxDelay = default(System.TimeSpan?)) { throw null; }
405-
public static Azure.Core.Delay CreateFixedDelay(System.TimeSpan? delay = default(System.TimeSpan?)) { throw null; }
403+
protected DelayStrategy(System.TimeSpan? maxDelay = default(System.TimeSpan?), double jitterFactor = 0.2) { }
404+
public static Azure.Core.DelayStrategy CreateExponentialDelayStrategy(System.TimeSpan? initialDelay = default(System.TimeSpan?), System.TimeSpan? maxDelay = default(System.TimeSpan?)) { throw null; }
405+
public static Azure.Core.DelayStrategy CreateFixedDelayStrategy(System.TimeSpan? delay = default(System.TimeSpan?)) { throw null; }
406406
public System.TimeSpan GetNextDelay(Azure.Response? response, int retryNumber) { throw null; }
407407
protected abstract System.TimeSpan GetNextDelayCore(Azure.Response? response, int retryNumber);
408408
protected static System.TimeSpan Max(System.TimeSpan val1, System.TimeSpan val2) { throw null; }
@@ -1035,7 +1035,7 @@ public static void SetAllowAutoRedirect(Azure.Core.HttpMessage message, bool all
10351035
}
10361036
public partial class RetryPolicy : Azure.Core.Pipeline.HttpPipelinePolicy
10371037
{
1038-
public RetryPolicy(int maxRetries = 3, Azure.Core.Delay? delay = null) { }
1038+
public RetryPolicy(int maxRetries = 3, Azure.Core.DelayStrategy? delayStrategy = null) { }
10391039
protected internal virtual void OnRequestSent(Azure.Core.HttpMessage message) { }
10401040
protected internal virtual System.Threading.Tasks.ValueTask OnRequestSentAsync(Azure.Core.HttpMessage message) { throw null; }
10411041
protected internal virtual void OnSendingRequest(Azure.Core.HttpMessage message) { }

sdk/core/Azure.Core/api/Azure.Core.net6.0.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,11 @@ public void AddPolicy(Azure.Core.Pipeline.HttpPipelinePolicy policy, Azure.Core.
398398
public static bool operator !=(Azure.Core.ContentType left, Azure.Core.ContentType right) { throw null; }
399399
public override string ToString() { throw null; }
400400
}
401-
public abstract partial class Delay
401+
public abstract partial class DelayStrategy
402402
{
403-
protected Delay(System.TimeSpan? maxDelay = default(System.TimeSpan?), double jitterFactor = 0.2) { }
404-
public static Azure.Core.Delay CreateExponentialDelay(System.TimeSpan? initialDelay = default(System.TimeSpan?), System.TimeSpan? maxDelay = default(System.TimeSpan?)) { throw null; }
405-
public static Azure.Core.Delay CreateFixedDelay(System.TimeSpan? delay = default(System.TimeSpan?)) { throw null; }
403+
protected DelayStrategy(System.TimeSpan? maxDelay = default(System.TimeSpan?), double jitterFactor = 0.2) { }
404+
public static Azure.Core.DelayStrategy CreateExponentialDelayStrategy(System.TimeSpan? initialDelay = default(System.TimeSpan?), System.TimeSpan? maxDelay = default(System.TimeSpan?)) { throw null; }
405+
public static Azure.Core.DelayStrategy CreateFixedDelayStrategy(System.TimeSpan? delay = default(System.TimeSpan?)) { throw null; }
406406
public System.TimeSpan GetNextDelay(Azure.Response? response, int retryNumber) { throw null; }
407407
protected abstract System.TimeSpan GetNextDelayCore(Azure.Response? response, int retryNumber);
408408
protected static System.TimeSpan Max(System.TimeSpan val1, System.TimeSpan val2) { throw null; }
@@ -1035,7 +1035,7 @@ public static void SetAllowAutoRedirect(Azure.Core.HttpMessage message, bool all
10351035
}
10361036
public partial class RetryPolicy : Azure.Core.Pipeline.HttpPipelinePolicy
10371037
{
1038-
public RetryPolicy(int maxRetries = 3, Azure.Core.Delay? delay = null) { }
1038+
public RetryPolicy(int maxRetries = 3, Azure.Core.DelayStrategy? delayStrategy = null) { }
10391039
protected internal virtual void OnRequestSent(Azure.Core.HttpMessage message) { }
10401040
protected internal virtual System.Threading.Tasks.ValueTask OnRequestSentAsync(Azure.Core.HttpMessage message) { throw null; }
10411041
protected internal virtual void OnSendingRequest(Azure.Core.HttpMessage message) { }

0 commit comments

Comments
 (0)