Udostępnij za pośrednictwem


OperationResult.WaitForCompletionAsync(CancellationToken) Method

Definition

Waits for the operation to complete processing on the service.

public virtual System.Threading.Tasks.ValueTask WaitForCompletionAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member WaitForCompletionAsync : System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask
override this.WaitForCompletionAsync : System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask
Public Overridable Function WaitForCompletionAsync (Optional cancellationToken As CancellationToken = Nothing) As ValueTask

Parameters

cancellationToken
CancellationToken

Returns

Exceptions

The cancellationToken was cancelled.

Remarks

Derived types may override WaitForCompletionAsync(CancellationToken) to implement different mechanisms for obtaining updates from the service regarding the progress of the operation. For example, if the derived type polls for status updates, it may provides overloads of WaitForCompletionAsync(CancellationToken) that allow the caller to specify the polling interval or delay strategy used to wait between sending request for updates. By default, WaitForCompletionAsync(CancellationToken) waits a default interval between calling UpdateStatusAsync(RequestOptions) to obtain a status updates, so if updates are delivered via streaming or another mechanism where a wait time is not required, derived types can override this method to update the status more frequently.

Applies to