Method WaitForCompletionAsync
WaitForCompletionAsync(Nullable<TimeSpan>, Nullable<TimeSpan>, CancellationToken)
Declaration
public Task<TableResult> 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 TablePollTimeout 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 than the timeout. Defaults to TablePollDelay. |
CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
Type | Description |
---|---|
Task<TableResult> | Task returning TableResult. |
Remarks
Table DDL operations are issued by methods ExecuteTableDDLAsync and SetTableLimitsAsync(String, TableLimits, TableDDLOptions, CancellationToken).
The wait is accomplished by polling the operation state at specified interval. When the operation completes, the table state should be Active or Dropped (only for DROP TABLE operation).
The result of this method is a TableResult 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 modified with any change in table state or metadata and will reflect the operation completion upon return.
This method need only be called on instances of TableResult returned from ExecuteTableDDLAsync and SetTableLimitsAsync(String, TableLimits, TableDDLOptions, CancellationToken). If you are using ExecuteTableDDLWithCompletionAsync or SetTableLimitsWithCompletionAsync(String, TableLimits, TableDDLOptions, CancellationToken) you need not call this method on the returned result, as it will already reflect operation completion.
Exceptions
Type | Condition |
---|---|
ArgumentException | If
timeout or pollDelay are
invalid or pollDelay is greater than the
timeout. |
TimeoutException | Table DDL operation has not completed within the timeout period. May also be thrown if the service becomes unreachable due to network connectivity. |
InvalidOperationException | If this method is called on an instance of TableResult other than those returned by ExecuteTableDDLAsync or SetTableLimitsAsync(String, TableLimits, TableDDLOptions, CancellationToken) or 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. |