You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sdk/core/Azure.Core/src/Shared/OperationInternal.cs
+31-15Lines changed: 31 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -63,34 +63,50 @@ internal class OperationInternal : OperationInternalBase
63
63
/// <summary>
64
64
/// Initializes a new instance of the <see cref="OperationInternal"/> class.
65
65
/// </summary>
66
-
/// <param name="clientDiagnostics">Used for diagnostic scope and exception creation. This is expected to be the instance created during the construction of your main client.</param>
67
66
/// <param name="operation">The long-running operation making use of this class. Passing "<c>this</c>" is expected.</param>
67
+
/// <param name="clientDiagnostics">Used for diagnostic scope and exception creation. This is expected to be the instance created during the construction of your main client.</param>
68
68
/// <param name="rawResponse">
69
-
/// The initial value of <see cref="OperationInternalBase.RawResponse"/>. Usually, long-running operation objects can be instantiated in two ways:
70
-
/// <list type="bullet">
71
-
/// <item>
72
-
/// When calling a client's "<c>Start<OperationName></c>" method, a service call is made to start the operation, and an <see cref="Operation"/> instance is returned.
73
-
/// In this case, the response received from this service call can be passed here.
74
-
/// </item>
75
-
/// <item>
76
-
/// When a user instantiates an <see cref="Operation"/> directly using a public constructor, there's no previous service call. In this case, passing <c>null</c> is expected.
77
-
/// </item>
78
-
/// </list>
69
+
/// The initial value of <see cref="OperationInternalBase.RawResponse"/>. Usually, long-running operation objects can be instantiated in two ways:
70
+
/// <list type="bullet">
71
+
/// <item>
72
+
/// When calling a client's "<c>Start<OperationName></c>" method, a service call is made to start the operation, and an <see cref="Operation"/> instance is returned.
73
+
/// In this case, the response received from this service call can be passed here.
74
+
/// </item>
75
+
/// <item>
76
+
/// When a user instantiates an <see cref="Operation"/> directly using a public constructor, there's no previous service call. In this case, passing <c>null</c> is expected.
77
+
/// </item>
78
+
/// </list>
79
79
/// </param>
80
80
/// <param name="operationTypeName">
81
-
/// The type name of the long-running operation making use of this class. Used when creating diagnostic scopes. If left <c>null</c>, the type name will be inferred based on the
82
-
/// parameter <paramref name="operation"/>.
81
+
/// The type name of the long-running operation making use of this class. Used when creating diagnostic scopes. If left <c>null</c>, the type name will be inferred based on the
82
+
/// parameter <paramref name="operation"/>.
83
83
/// </param>
84
84
/// <param name="scopeAttributes">The attributes to use during diagnostic scope creation.</param>
85
-
/// <param name="fallbackStrategy">The fallback delay strategy when Retry-After header is not present. When it is present, the longer of the two delays will be used. Default is <see cref="ConstantDelayStrategy"/>.</param>
85
+
/// <param name="fallbackStrategy"> The delay strategy to use. Default is <see cref="FixedDelayWithNoJitterStrategy"/>.</param>
Copy file name to clipboardExpand all lines: sdk/core/Azure.Core/src/Shared/OperationInternalOfT.cs
+39-24Lines changed: 39 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -72,39 +72,59 @@ internal class OperationInternal<T> : OperationInternalBase
72
72
/// <summary>
73
73
/// Initializes a new instance of the <see cref="OperationInternal{T}"/> class.
74
74
/// </summary>
75
-
/// <param name="clientDiagnostics">Used for diagnostic scope and exception creation. This is expected to be the instance created during the construction of your main client.</param>
76
75
/// <param name="operation">The long-running operation making use of this class. Passing "<c>this</c>" is expected.</param>
76
+
/// <param name="clientDiagnostics">Used for diagnostic scope and exception creation. This is expected to be the instance created during the construction of your main client.</param>
77
77
/// <param name="rawResponse">
78
-
/// The initial value of <see cref="OperationInternalBase.RawResponse"/>. Usually, long-running operation objects can be instantiated in two ways:
79
-
/// <list type="bullet">
80
-
/// <item>
81
-
/// When calling a client's "<c>Start<OperationName></c>" method, a service call is made to start the operation, and an <see cref="Operation{T}"/> instance is returned.
82
-
/// In this case, the response received from this service call can be passed here.
83
-
/// </item>
84
-
/// <item>
85
-
/// When a user instantiates an <see cref="Operation{T}"/> directly using a public constructor, there's no previous service call. In this case, passing <c>null</c> is expected.
86
-
/// </item>
87
-
/// </list>
78
+
/// The initial value of <see cref="OperationInternalBase.RawResponse"/>. Usually, long-running operation objects can be instantiated in two ways:
79
+
/// <list type="bullet">
80
+
/// <item>
81
+
/// When calling a client's "<c>Start<OperationName></c>" method, a service call is made to start the operation, and an <see cref="Operation{T}"/> instance is returned.
82
+
/// In this case, the response received from this service call can be passed here.
83
+
/// </item>
84
+
/// <item>
85
+
/// When a user instantiates an <see cref="Operation{T}"/> directly using a public constructor, there's no previous service call. In this case, passing <c>null</c> is expected.
86
+
/// </item>
87
+
/// </list>
88
88
/// </param>
89
89
/// <param name="operationTypeName">
90
-
/// The type name of the long-running operation making use of this class. Used when creating diagnostic scopes. If left <c>null</c>, the type name will be inferred based on the
91
-
/// parameter <paramref name="operation"/>.
90
+
/// The type name of the long-running operation making use of this class. Used when creating diagnostic scopes. If left <c>null</c>, the type name will be inferred based on the
91
+
/// parameter <paramref name="operation"/>.
92
92
/// </param>
93
93
/// <param name="scopeAttributes">The attributes to use during diagnostic scope creation.</param>
94
-
/// <param name="fallbackStrategy">The fallback delay strategy when Retry-After header is not present. When it is present, the longer of the two delays will be used. Default is <see cref="ConstantDelayStrategy"/>.</param>
94
+
/// <param name="fallbackStrategy">The delay strategy when Retry-After header is not present. When it is present, the longer of the two delays will be used.
95
+
/// Default is <see cref="FixedDelayWithNoJitterStrategy"/>.</param>
/// Periodically calls <see cref="OperationInternalBase.UpdateStatusAsync(CancellationToken)"/> until the long-running operation completes.
162
182
/// After each service call, a retry-after header may be returned to communicate that there is no reason to poll
163
-
/// for status change until the specified time has passed. The maximum of the retry after value and the fallback <see cref="DelayStrategyInternal"/>
164
-
/// is then used as the wait interval.
183
+
/// for status change until the specified time has passed.
165
184
/// Headers supported are: "Retry-After", "retry-after-ms", and "x-ms-retry-after-ms",
166
185
/// <example>Usage example:
167
186
/// <code>
@@ -200,8 +219,7 @@ public async ValueTask<Response<T>> WaitForCompletionAsync(TimeSpan pollingInter
200
219
/// <summary>
201
220
/// Periodically calls <see cref="OperationInternalBase.UpdateStatus(CancellationToken)"/> until the long-running operation completes.
202
221
/// After each service call, a retry-after header may be returned to communicate that there is no reason to poll
203
-
/// for status change until the specified time has passed. The maximum of the retry after value and the fallback <see cref="DelayStrategyInternal"/>
204
-
/// is then use as the wait interval.
222
+
/// for status change until the specified time has passed.
205
223
/// Headers supported are: "Retry-After", "retry-after-ms", and "x-ms-retry-after-ms",
206
224
/// <example>Usage example:
207
225
/// <code>
@@ -218,11 +236,8 @@ public Response<T> WaitForCompletion(CancellationToken cancellationToken)
218
236
219
237
/// <summary>
220
238
/// Periodically calls <see cref="OperationInternalBase.UpdateStatus(CancellationToken)"/> until the long-running operation completes. The interval
221
-
/// between calls is defined by the property <see cref="ConstantDelayStrategy.DefaultPollingInterval"/>, but it can change based on information returned
222
-
/// from the server. After each service call, a retry-after header may be returned to communicate that there is no reason to poll
223
-
/// for status change until the specified time has passed. In this case, the maximum value between the <see cref="ConstantDelayStrategy.DefaultPollingInterval"/>
224
-
/// property and the retry-after header is chosen as the wait interval. Headers supported are: "Retry-After", "retry-after-ms",
225
-
/// and "x-ms-retry-after-ms".
239
+
/// between calls is defined by the <see cref="FixedDelayWithNoJitterStrategy"/>, which takes into account any retry-after header that is returned
240
+
/// from the server.
226
241
/// <example>Usage example:
227
242
/// <code>
228
243
/// public async ValueTask<Response<T>> WaitForCompletionAsync(CancellationToken cancellationToken) =>
0 commit comments