Table of Contents

Class DLCAsync<T>

Namespace
DLCToolkit
Assembly
DLCToolkit.dll

An awaitable object that is returned by async operations so you can wait for completion in a coroutine as well as access progress and status information. Used to wait for an async operation to be completed with a result object.

public class DLCAsync<T> : DLCAsync, IEnumerator

Type Parameters

T

The generic result type

Inheritance
DLCAsync<T>
Implements
Derived
Inherited Members

Constructors

DLCAsync()

Create a new instance.

public DLCAsync()

Properties

Result

Get the generic result of the async operation.

public T Result { get; }

Property Value

T

Methods

Complete(bool, T)

Complete the operation with the specified success status. This will cause IsDone to become true and Progress to become 1.

public void Complete(bool success, T result = default)

Parameters

success bool

Was the operation completed successfully

result T

An optional result object

Completed(bool, T)

Create a new instance with the specified success status. This will cause IsDone to become true and Progress to become 1.

public static DLCAsync<T> Completed(bool success, T result = default)

Parameters

success bool

Was the operation completed successfully

result T

An optional result object

Returns

DLCAsync<T>

Error(string)

Create a new instance an error status. This will cause IsDone to become true and Progress to become 1.

public static DLCAsync<T> Error(string error)

Parameters

error string

The error message for the failure

Returns

DLCAsync<T>

Error(string, T)

Complete the operation with an error status. This will cause IsDone to become true and Progress to become 1.

public void Error(string status, T result = default)

Parameters

status string

The error message for the failure

result T

An optional result object