UniTaskCompletionSource<T> Class
Namespace: Cysharp.Threading.Tasks
Assembly: cs.temp.dll.dll
public class UniTaskCompletionSource<T> : IUniTaskSource<T>, IUniTaskSource, IValueTaskSource, IValueTaskSource<T>, IPromise<T>, IResolvePromise<T>, IRejectPromise, ICancelPromise
Inheritance
System.Object → UniTaskCompletionSource<T>Implements
System.Threading.Tasks.Sources.IValueTaskSource
System.Threading.Tasks.Sources.IValueTaskSource<T>
IPromise<T>
Type Parameters
T
Members
Constructors
Name | Description |
---|---|
UniTaskCompletionSource() |
Properties
Name | Description |
---|---|
Task |
Methods
Name | Description |
---|---|
GetResult(Int16) | |
GetStatus(Int16) | |
OnCompleted(Action<Object>, Object, Int16) | |
TrySetCanceled(CancellationToken) | |
TrySetException(Exception) | |
TrySetResult(T) | |
UnsafeGetStatus() |
Explicit Interface Implementations
Name | Description |
---|---|
IUniTaskSource.GetResult(Int16) |
Constructors
UniTaskCompletionSource()
public UniTaskCompletionSource()
Properties
Task
public UniTask<T> Task { get; }
Property Value
- UniTask<T>
Methods
GetResult(Int16)
public T GetResult(short token)
Parameters
token
System.Int16
Returns
- T
GetStatus(Int16)
public UniTaskStatus GetStatus(short token)
Parameters
token
System.Int16
Returns
OnCompleted(Action<Object>, Object, Int16)
public void OnCompleted(Action<object> continuation, object state, short token)
Parameters
continuation
Action<System.Object>state
System.Objecttoken
System.Int16
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
Exception
Returns
- System.Boolean
TrySetResult(T)
public bool TrySetResult(T result)
Parameters
result
T
Returns
- System.Boolean
UnsafeGetStatus()
public UniTaskStatus UnsafeGetStatus()
Returns
Explicit Interface Implementations
IUniTaskSource.GetResult(Int16)
void IUniTaskSource.GetResult(short token)
Parameters
token
System.Int16
Implements
System.Threading.Tasks.Sources.IValueTaskSource
System.Threading.Tasks.Sources.IValueTaskSource<TResult>