# UniTaskCompletionSource Class | UniTask

Show / Hide Table of Contents

# UniTaskCompletionSource Class

###### Namespace: Cysharp.Threading.Tasks

###### Assembly: cs.temp.dll.dll

    public class UniTaskCompletionSource : IUniTaskSource, IPromise, IResolvePromise, IRejectPromise, ICancelPromise

##### Inheritance

System.Object → UniTaskCompletionSource

##### Implements

IUniTaskSource
IPromise
IResolvePromise
IRejectPromise
ICancelPromise

### Members

#### Constructors

Name | Description
--- | ---
UniTaskCompletionSource() |

#### Properties

Name | Description
--- | ---
Task |

#### Methods

Name | Description
--- | ---
Finalize() |
GetResult(Int16) |
GetStatus(Int16) |
OnCompleted(Action<Object>, Object, Int16) |
Reset() |
TrySetCanceled(CancellationToken) |
TrySetException(Exception) |
TrySetResult() |
UnsafeGetStatus() |

### Constructors

#### UniTaskCompletionSource()

    public UniTaskCompletionSource()

### Properties

#### Task

    public UniTask Task { get; }

##### Property Value

UniTask

### Methods

#### Finalize()

    protected void Finalize()

#### GetResult(Int16)

    public void GetResult(short token)

##### Parameters

`token` System.Int16

#### GetStatus(Int16)

    public UniTaskStatus GetStatus(short token)

##### Parameters

`token` System.Int16

##### Returns

UniTaskStatus

#### OnCompleted(Action<Object>, Object, Int16)

    public void OnCompleted(Action<object> continuation, object state, short token)

##### Parameters

`continuation` System.Action<System.Object>
`state` System.Object
`token` System.Int16

#### Reset()

    public void Reset()

#### TrySetCanceled(CancellationToken)

    public bool TrySetCanceled(CancellationToken cancellationToken = default(CancellationToken))

##### Parameters

`cancellationToken` System.Threading.CancellationToken

##### Returns

System.Boolean

#### TrySetException(Exception)

    public bool TrySetException(Exception exception)

##### Parameters

`exception` System.Exception

##### Returns

System.Boolean

#### TrySetResult()

    public bool TrySetResult()

##### Returns

System.Boolean

#### UnsafeGetStatus()

    public UniTaskStatus UnsafeGetStatus()

##### Returns

UniTaskStatus

### Implements

IUniTaskSource
IPromise
IResolvePromise
IRejectPromise
ICancelPromise