コード例 #1
0
        private async ValueTask <Response> WaitForCompletionAsync(bool async, OperationInternalBase operation, TimeSpan?suggestedInterval, CancellationToken cancellationToken)
        {
            while (true)
            {
                Response response = async ? await operation.UpdateStatusAsync(cancellationToken).ConfigureAwait(false) : operation.UpdateStatus(cancellationToken);

                if (operation.HasCompleted)
                {
                    return(operation.RawResponse);
                }

                await Delay(async, _delayStrategy.GetNextDelay(response, suggestedInterval), cancellationToken).ConfigureAwait(false);
            }
        }
コード例 #2
0
 public Response WaitForCompletionResponse(OperationInternalBase operation, TimeSpan?suggestedInterval, CancellationToken cancellationToken)
 => WaitForCompletionAsync(false, operation, suggestedInterval, cancellationToken).EnsureCompleted();
コード例 #3
0
 public ValueTask <Response> WaitForCompletionResponseAsync(OperationInternalBase operation, TimeSpan?suggestedInterval, CancellationToken cancellationToken)
 => WaitForCompletionAsync(true, operation, suggestedInterval, cancellationToken);