OperationInternalBase
Returns true if the long-running operation has completed.
Usage example:
public bool HasCompleted => _operationInternal.HasCompleted;
The last HTTP response received from the server. Its update already handled in calls to "UpdateStatus" and
"WaitForCompletionAsync", but custom methods not supported by this class, such as "CancelOperation",
must update it as well.
Usage example:
public Response GetRawResponse() => _operationInternal.RawResponse;
protected OperationInternalBase(ClientDiagnostics clientDiagnostics, string operationTypeName, IEnumerable<KeyValuePair<string, string>> scopeAttributes = null, DelayStrategy fallbackStrategy = null)
Calls the server to get the latest status of the long-running operation, handling diagnostic scope creation for distributed
tracing. The default scope name can be changed with the "operationTypeName" parameter passed to the constructor.
Usage example:
public Response UpdateStatus(CancellationToken cancellationToken) => _operationInternal.UpdateStatus(cancellationToken);
Calls the server to get the latest status of the long-running operation, handling diagnostic scope creation for distributed
tracing. The default scope name can be changed with the "operationTypeName" parameter passed to the constructor.
Usage example:
public async ValueTask<Response> UpdateStatusAsync(CancellationToken cancellationToken) =>
await _operationInternal.UpdateStatusAsync(cancellationToken).ConfigureAwait(false);
protected abstract ValueTask<Response> UpdateStatusAsync(bool async, CancellationToken cancellationToken)
Periodically calls UpdateStatus until the long-running operation completes.
After each service call, a retry-after header may be returned to communicate that there is no reason to poll
for status change until the specified time has passed. The maximum of the retry after value and the fallback strategy
is then used as the wait interval.
Headers supported are: "Retry-After", "retry-after-ms", and "x-ms-retry-after-ms",
and "x-ms-retry-after-ms".
Usage example:
public async ValueTask<Response<T>> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken) =>
await _operationInternal.WaitForCompletionAsync(pollingInterval, cancellationToken).ConfigureAwait(false);
public Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken)
Periodically calls UpdateStatus until the long-running operation completes. The interval
between calls is defined by the parameter pollingInterval, but it can change based on information returned
from the server. After each service call, a retry-after header may be returned to communicate that there is no reason to poll
for status change until the specified time has passed. In this case, the maximum value between the pollingInterval
parameter and the retry-after header is chosen as the wait interval. Headers supported are: "Retry-After", "retry-after-ms",
and "x-ms-retry-after-ms".
Usage example:
public async ValueTask<Response<T>> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken) =>
await _operationInternal.WaitForCompletionAsync(pollingInterval, cancellationToken).ConfigureAwait(false);
Periodically calls UpdateStatusAsync until the long-running operation completes.
After each service call, a retry-after header may be returned to communicate that there is no reason to poll
for status change until the specified time has passed. The maximum of the retry after value and the fallback strategy
is then used as the wait interval.
Headers supported are: "Retry-After", "retry-after-ms", and "x-ms-retry-after-ms",
Usage example:
public async ValueTask<Response<T>> WaitForCompletionAsync(CancellationToken cancellationToken) =>
await _operationInternal.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
public ValueTask<Response> WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken)
Periodically calls UpdateStatusAsync until the long-running operation completes. The interval
between calls is defined by the parameter pollingInterval, but it can change based on information returned
from the server. After each service call, a retry-after header may be returned to communicate that there is no reason to poll
for status change until the specified time has passed. In this case, the maximum value between the pollingInterval
parameter and the retry-after header is chosen as the wait interval. Headers supported are: "Retry-After", "retry-after-ms",
and "x-ms-retry-after-ms".
Usage example:
public async ValueTask<Response<T>> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken) =>
await _operationInternal.WaitForCompletionAsync(pollingInterval, cancellationToken).ConfigureAwait(false);
protected ValueTask<Response> WaitForCompletionResponseAsync(bool async, TimeSpan? pollingInterval, string scopeName, CancellationToken cancellationToken)