Method AwaitCompletionAsync
AwaitCompletionAsync(CancellationToken)
Awaits the completion of the job asynchronously. If the job is completed successfully, the task result will contain true. You can call this method multiple times to get the result, it will not re-run the job or wait again for the completion. It is safe to call this method after the job has been completed. This is thread-safe.
public Task<ApiResponse<bool>> AwaitCompletionAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<ApiResponse<bool>>
A task that represents the asynchronous operation. The task result contains an ApiResponse<T> indicating the job completion status.
Exceptions
- ObjectDisposedException
Thrown if the object has been disposed.
AwaitCompletionAsync(TimeSpan, CancellationToken)
Awaits the completion of the job asynchronously. If the job is completed successfully, the task result will contain true. You can call this method multiple times to get the result, it will not re-run the job or wait again for the completion. It is safe to call this method after the job has been completed. This is thread-safe.
public Task<ApiResponse<bool>> AwaitCompletionAsync(TimeSpan waitDelayBetweenCompletionPolls, CancellationToken cancellationToken = default)
Parameters
waitDelayBetweenCompletionPolls
TimeSpanThe delay between completion polls.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<ApiResponse<bool>>
A task that represents the asynchronous operation. The task result contains an ApiResponse<T> indicating the job completion status.
Exceptions
- ObjectDisposedException
Thrown if the object has been disposed.