Table of Contents

Method AwaitCompletionAsync

Namespace
Kepware.Api.Model.Services
Assembly
Kepware.Api.dll

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 CancellationToken

The 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 TimeSpan

The delay between completion polls.

cancellationToken CancellationToken

The 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.