Method WaitForCompletionAsync
WaitForCompletionAsync(Nullable<TimeSpan>, Nullable<TimeSpan>, CancellationToken)
Asynchronously waits for completion of admin DDL operations.
Declaration
public Task<AdminResult> WaitForCompletionAsync(Nullable<TimeSpan> timeout = null, Nullable<TimeSpan> pollDelay = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Nullable<TimeSpan> | timeout | (Optional) Timeout reflecting how long to keep polling for the operation completion. Must be positive value. Defaults to AdminPollTimeout if the latter is set or to no timeout if the latter is not set. |
Nullable<TimeSpan> | pollDelay | (Optional) Delay between successive polls, determines how often the polls are performed. Must be positive value and not greater then the timeout. Defaults to AdminPollDelay. |
CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
Type | Description |
---|---|
Task<AdminResult> | Task returning AdminResult. |
Remarks
The wait is accomplished by polling the operation state at specified interval. When the operation completes, the state of the operation should be Complete.
The result of this method is an AdminResult that represents the final state of the operation (which is the result of the last poll). If the operation fails, this method will throw exception with the information about the operation failure.
Note that in addition to the result returned, this calling instance is also modified to reflect the operation completion.
You need not call this method on the result returned by ExecuteAdminWithCompletionAsync since it will already reflect the operation completion.
Exceptions
Type | Condition |
---|---|
ArgumentException | If
timeout or pollDelay are
invalid or pollDelay is greater than the
timeout. |
TimeoutException | Admin DDL operation has not completed within the timeout period. May also be thrown if the service becomes unreachable due to network connectivity. |
InvalidOperationException | If the service is not in a valid state to perform the operation. |
NoSQLException | NoSQLException or one of its subclasses may reflect the failure of the operation being polled for. See documentation for corresponding subclass of NoSQLException. |