bool | IsPending[Get] |
bool | IsCompleted[Get] Indicates whether the task has completed. |
bool | IsFaulted[Get] Whether the task completed due to an unhandled exception. |
bool | HasResult[Get] Whether there is a result available. |
static readonly Action< List< TResult >, OVRTask< TResult[]> > |
static OVRTask< TResult[]> | WhenAll< TResult > ( IEnumerable< OVRTask< TResult > > tasks ) Creates a task that completes when all of the supplied tasks have completed. |
static OVRTask< List< TResult > > | Creates a task that completes when all of the supplied tasks have completed. |
static OVRTask< TResult > | FromResult< TResult > ( TResult result ) Creates an already-complete task. |
static void | Sets the result of a pending task. |
static OVRTask< TResult > | Create< TResult > ( Guid taskId ) Creates a new task. |
static static | OVRTask ( ) |
static bool | |
static bool | |
static OVRTask<(T1, T2)> | Creates a new task that will complete when all of the given tasks have completed. |
static OVRTask<(T1, T2, T3)> | Creates a new task that will complete when all of the given tasks have completed. |
static OVRTask<(T1, T2, T3, T4)> | WhenAll< T1, T2, T3, T4 > ( OVRTask< T1 > task1, OVRTask< T2 > task2, OVRTask< T3 > task3, OVRTask< T4 > task4 ) Creates a new task that will complete when all of the given tasks have completed. |
static OVRTask<(T1, T2, T3, T4, T5)> | |
static OVRTask<(T1, T2, T3, T4, T5, T6)> | |
static OVRTask<(T1, T2, T3, T4, T5, T6, T7)> | |
static OVRTask<(T1, T2, T3, T4, T5, T6, T7, T8)> |
bool | Removes internal data related to the task. |
bool | |
Exception | GetException ( ) Get the exception if the task is in a faulted state. |
TResult | GetResult ( ) Gets the result of the asynchronous operation. |
bool | TryGetResult ( out TResult result ) Tries to get the result of the asynchronous operation. |
ValueTask< TResult > | ToValueTask ( ) Converts the task to a ValueTask. |
GetAwaiter ( ) Gets an awaiter that satisfies the await contract. | |
void | ContinueWith ( Action< TResult > onCompleted ) Registers a delegate to be invoked on completion of the task. |
void | Registers a delegate that will get called on completion of the task. |
void | |
void | Dispose ( ) Disposes of the task. |
bool | |
override bool | Equals ( object obj ) |
override int | GetHashCode ( ) |
override string | ToString ( ) |
bool OVRTask< TResult >.IsPending |
---|
No description available.
|
bool OVRTask< TResult >.IsCompleted |
---|
Indicates whether the task has completed. Choose only one pattern out of the three proposed way of awaiting for the task completion: Polling,async/await or ContinueWith(Action<TResult>) as all three patterns will end up calling the GetResult which can only be called once. Returns True if the task has completed. GetResult can be called. |
bool OVRTask< TResult >.IsFaulted |
---|
Whether the task completed due to an unhandled exception. If the task is in a faulted state, then you can extract the exception with GetException. |
bool OVRTask< TResult >.HasResult |
---|
Whether there is a result available. This property is true when the OVRTask<TResult> is complete (IsCompleted is true) and GetResult has not already been called. Note that GetResult is called implicitly when using await or ContinueWith. See Also: |
readonly Action<List<TResult>, OVRTask<TResult[]> > OVRTask< TResult >._onCombinedTaskCompleted |
---|
No description available.
|
static OVRTask< TResult[]> OVRTask< TResult >.WhenAll< TResult > ( IEnumerable< OVRTask< TResult > > tasks ) |
---|
Creates a task that completes when all of the supplied tasks have completed. This can be used to combine multiple tasks into a single task. The returned task completes when all tasks in tasks complete. The result of the returned task is an array containing the results of each individual task. The results are arranged in the same order as the original tasks list. Parameters tasks The tasks to combine Others TResult The type of the result produced by the tasks . Returns A new task which is completed when all tasks have completed. Exceptions ArgumentNullException Thrown if tasks is null. See Also: OVRTask<TResult> |
static OVRTask< List< TResult > > OVRTask< TResult >.WhenAll< TResult > ( IEnumerable< OVRTask< TResult > > tasks, List< TResult > results ) |
---|
Creates a task that completes when all of the supplied tasks have completed. This can be used to combine multiple tasks into a single task. The returned task completes when all tasks in tasks complete. The result of each task in tasks is added to results . The results are in the same order as tasks . The list in the combined task is a reference to results . This allows the caller to own (and potentially reuse) the memory for the list of results. It is undefined behavior to access results before the returned task completes. Parameters tasks The tasks to combine resultsA list to store the results in. The list is cleared before adding any results to it. Others TResult The type of the result produced by the tasks . Returns A new task which completes when all tasks are complete. Exceptions ArgumentNullException Thrown if tasks is null. ArgumentNullExceptionThrown if results is null. See Also: OVRTask<TResult> |
static OVRTask< TResult > OVRTask< TResult >.FromResult< TResult > ( TResult result ) |
---|
Creates an already-complete task. This creates a completed task whose result is result . Parameters result The result of the task. Others TResult The type of the result. Returns Returns a new, completed task-like object whose result is result . |
static void OVRTask< TResult >.SetResult< TResult > ( Guid id, TResult result ) |
---|
Sets the result of a pending task. Set the result of a task previously created with Create<TResult>. When this method returns, OVRTask<TResult>.IsCompleted will be true.
This allows you to await on MyOpAsync:
Parameters id The task's unique id. resultThe result the task should have. Others TResult The type of the result. Exceptions InvalidOperationException Thrown if the task with id id already has a result. |
static OVRTask< TResult > OVRTask< TResult >.Create< TResult > ( Guid taskId ) |
---|
Creates a new task. This method creates a new pending task. When the task completes, set its result with SetResult<TResult>. The returned task is in a pending state; that is, OVRTask<TResult>.IsCompleted is False until you later set its result with SetResult<TResult>. The taskId must be unique to the new task. You may use any Guid as long as it has not previously been used to create a task. Use
Parameters taskId The id used to assign the new task. Others TResult The type of the result. Returns Returns a new task which completes when you call SetResult<TResult>. Exceptions ArgumentException Thrown if taskId refers to an existing task. |
static OVRTask< TResult >.OVRTask ( ) |
---|
No description available.
|
static bool OVRTask< TResult >.operator== ( OVRTask< TResult > lhs, OVRTask< TResult > rhs ) |
---|
No description available.
|
static bool OVRTask< TResult >.operator!= ( OVRTask< TResult > lhs, OVRTask< TResult > rhs ) |
---|
No description available.
|
static OVRTask<(T1, T2)> OVRTask< TResult >.WhenAll< T1, T2 > ( OVRTask< T1 > task1, OVRTask< T2 > task2 ) |
---|
Creates a new task that will complete when all of the given tasks have completed. This method can be used to combine multiple tasks into a single task that depends on all of them. When the returned task completes, the results of all combined tasks can be accessed through the result of the returned task. The type of the result is a tuple containing the result types of each input task, that is
For example,
Parameters task1 The first task to combine task2The second task to combine Returns A task that represents the completion of all input tasks. |
static OVRTask<(T1, T2, T3)> OVRTask< TResult >.WhenAll< T1, T2, T3 > ( OVRTask< T1 > task1, OVRTask< T2 > task2, OVRTask< T3 > task3 ) |
---|
Creates a new task that will complete when all of the given tasks have completed. This method can be used to combine multiple tasks into a single task that depends on all of them. When the returned task completes, the results of all combined tasks can be accessed through the result of the returned task. The type of the result is a tuple containing the result types of each input task, that is
For example,
Parameters task1 The first task to combine task2The second task to combine task3The third task to combine Returns A task that represents the completion of all input tasks. |
static OVRTask<(T1, T2, T3, T4)> OVRTask< TResult >.WhenAll< T1, T2, T3, T4 > ( OVRTask< T1 > task1, OVRTask< T2 > task2, OVRTask< T3 > task3, OVRTask< T4 > task4 ) |
---|
Creates a new task that will complete when all of the given tasks have completed. This method can be used to combine multiple tasks into a single task that depends on all of them. When the returned task completes, the results of all combined tasks can be accessed through the result of the returned task. The type of the result is a tuple containing the result types of each input task, that is
For example,
Parameters task1 The first task to combine task2The second task to combine task3The third task to combine task4The forth task to combine Returns A task that represents the completion of all input tasks. |
static OVRTask<(T1, T2, T3, T4, T5)> OVRTask< TResult >.WhenAll< T1, T2, T3, T4, T5 > ( OVRTask< T1 > task1, OVRTask< T2 > task2, OVRTask< T3 > task3, OVRTask< T4 > task4, OVRTask< T5 > task5 ) |
---|
Creates a new task that will complete when all of the given tasks have completed. This method can be used to combine multiple tasks into a single task that depends on all of them. When the returned task completes, the results of all combined tasks can be accessed through the result of the returned task. The type of the result is a tuple containing the result types of each input task, that is
For example,
Parameters task1 The first task to combine task2The second task to combine task3The third task to combine task4The forth task to combine task5The fifth task to combine Returns A task that represents the completion of all input tasks. |
static OVRTask<(T1, T2, T3, T4, T5, T6)> OVRTask< TResult >.WhenAll< T1, T2, T3, T4, T5, T6 > ( OVRTask< T1 > task1, OVRTask< T2 > task2, OVRTask< T3 > task3, OVRTask< T4 > task4, OVRTask< T5 > task5, OVRTask< T6 > task6 ) |
---|
Creates a new task that will complete when all of the given tasks have completed. This method can be used to combine multiple tasks into a single task that depends on all of them. When the returned task completes, the results of all combined tasks can be accessed through the result of the returned task. The type of the result is a tuple containing the result types of each input task, that is
For example,
Parameters task1 The first task to combine task2The second task to combine task3The third task to combine task4The forth task to combine task5The fifth task to combine task6The sixth task to combine Returns A task that represents the completion of all input tasks. |
static OVRTask<(T1, T2, T3, T4, T5, T6, T7)> OVRTask< TResult >.WhenAll< T1, T2, T3, T4, T5, T6, T7 > ( OVRTask< T1 > task1, OVRTask< T2 > task2, OVRTask< T3 > task3, OVRTask< T4 > task4, OVRTask< T5 > task5, OVRTask< T6 > task6, OVRTask< T7 > task7 ) |
---|
Creates a new task that will complete when all of the given tasks have completed. This method can be used to combine multiple tasks into a single task that depends on all of them. When the returned task completes, the results of all combined tasks can be accessed through the result of the returned task. The type of the result is a tuple containing the result types of each input task, that is
For example,
Parameters task1 The first task to combine task2The second task to combine task3The third task to combine task4The forth task to combine task5The fifth task to combine task6The sixth task to combine task7The seventh task to combine Returns A task that represents the completion of all input tasks. |
static OVRTask<(T1, T2, T3, T4, T5, T6, T7, T8)> OVRTask< TResult >.WhenAll< T1, T2, T3, T4, T5, T6, T7, T8 > ( OVRTask< T1 > task1, OVRTask< T2 > task2, OVRTask< T3 > task3, OVRTask< T4 > task4, OVRTask< T5 > task5, OVRTask< T6 > task6, OVRTask< T7 > task7, OVRTask< T8 > task8 ) |
---|
Creates a new task that will complete when all of the given tasks have completed. This method can be used to combine multiple tasks into a single task that depends on all of them. When the returned task completes, the results of all combined tasks can be accessed through the result of the returned task. The type of the result is a tuple containing the result types of each input task, that is
For example,
Parameters task1 The first task to combine task2The second task to combine task3The third task to combine task4The forth task to combine task5The fifth task to combine task6The sixth task to combine task7The seventh task to combine task8The eighth task to combine Returns A task that represents the completion of all input tasks. |
bool OVRTask< TResult >.TryRemoveInternalData ( ) |
---|
Removes internal data related to the task. Removes incremental result subscribers and internal data. Call this when the task completes. Returns True if the task was pending, otherwise False |
bool OVRTask< TResult >.TryInvokeContinuation ( ) |
---|
No description available.
|
Exception OVRTask< TResult >.GetException ( ) |
---|
Get the exception if the task is in a faulted state. If IsFaulted is True, then this method gets the exception associated with this method. Similar to GetResult, you can only get the exception once and throws if there is no exception. When using await or ContinueWith, you do not need to explicitly get the exception. Use this method when you have an exception when it is implicitly created by the compiler and you query the task object directly, as in the following example:
Returns Returns the Exception associated with the task. Exceptions InvalidOperationException Thrown if IsFaulted is False. |
TResult OVRTask< TResult >.GetResult ( ) |
---|
Gets the result of the asynchronous operation. This method should only be called once IsCompleted is true. Calling it multiple times will throw InvalidOperationException. Note that GetResult is called implicitly when using await or ContinueWith. You should not call this method explicitly when using one of those mechanisms. Returns Returns the result of type TResult . Exceptions InvalidOperationException Thrown when the task doesn't have any available result. This could happen if the method is called before IsCompleted is true, after the task has been disposed of, if this method has already been called once, or if an exception was thrown during the task's execution. See Also: |
bool OVRTask< TResult >.TryGetResult ( out TResult result ) |
---|
Tries to get the result of the asynchronous operation. This method may safely be called at any time. It tests whether the operation is both complete (IsCompleted is True) and the result has not already been retrieved with GetResult (HasResult is True). If the result is available, result is set to the result and this method returns True. This method is equivalent to (though more efficient than) the following:
Parameters result Set to the result of the task, if one is available. Otherwise, it is set to the default value for TResult . Returns True if this task is complete and a result is available. Exceptions InvalidOperationException Thrown when the task doesn't have any available result. This could happen if the method is called before IsCompleted is true, after the task has been disposed of or if this method has already been called once. |
ValueTask< TResult > OVRTask< TResult >.ToValueTask ( ) |
---|
Converts the task to a ValueTask. This method converts this OVRTask<TResult> to a ValueTask. A ValueTask is similar to an OVRTask. Key differences:
The above are only supported on the Task object. Invoking this method also invalidates this OVRTask<TResult>. It is invalid to continue using an OVRTask<TResult> after calling ToValueTask. Returns Returns a new ValueTask that completes when the asynchronous operation completes. Exceptions InvalidOperationException Thrown if the task is not pending (IsCompleted is true) and does not have a result (HasResult is false) InvalidOperationExceptionThrown if the task has already been awaited. InvalidOperationExceptionThrown if ContinueWith has already been called. |
Awaiter OVRTask< TResult >.GetAwaiter ( ) |
---|
Gets an awaiter that satisfies the await contract. This allows an OVRTask<T> to be awaited using the await keyword. Typically, you should not call this directly; instead, it is invoked by the compiler, e.g.,
Requires the main thread to complete the await contract - blocking can result in an infinite loop. Returns Returns an Awaiter-like object that satisfies the await pattern. |
void OVRTask< TResult >.ContinueWith ( Action< TResult > onCompleted ) |
---|
Registers a delegate to be invoked on completion of the task. The delegate will be invoked with the TResult result as parameter. Do not use in conjunction with any other methods (await or calling GetResult). Note: If the task throws an exception during execution, there is no way to catch it in when using ContinueWith. Most Meta XR Core SDK calls that return an OVRTask do not throw, but it is possible to return an OVRTask<TResult> from your own async method, which can still throw. For example,
In the above example, the exception generated by DoSomethingAsync is caught in MethodA, but there is no way to catch it in MethodB because it uses ContinueWith rather than await. The exception is still thrown, however. Parameters onCompleted A delegate to be invoked when this task completes. If the task is already complete, onCompleted is invoked immediately. See Also: Exceptions ArgumentNullException Thrown if onCompleted is null. InvalidOperationExceptionThrown if this task is already being awaited. InvalidOperationExceptionThrown if this task is already used in another ContinueWith. InvalidOperationExceptionThrown if this task is already used as a ValueTask (ToValueTask). InvalidOperationExceptionThrown if this task is already used or as an Awaitable. (ToAwaitable, only available in Unity 2023.1+). |
void OVRTask< TResult >.ContinueWith< T > ( Action< TResult, T > onCompleted, T state ) |
---|
Registers a delegate that will get called on completion of the task. The delegate will be invoked with state and the TResult result as parameters. Do not use in conjunction with any other methods (await or calling GetResult). Note: If the task throws an exception during execution, there is no way to catch it in when using a callback. See ContinueWith(Action<TResult>) for more details. Parameters onCompleted A delegate to be invoked when this task completes. If the task is already complete, onCompleted is invoked immediately. stateAn object to store and pass to onCompleted . See Also: Exceptions ArgumentNullException Thrown if onCompleted is null. InvalidOperationExceptionThrown if this task is already being awaited. InvalidOperationExceptionThrown if this task is already used in another ContinueWith. InvalidOperationExceptionThrown if this task is already used as a ValueTask (ToValueTask). InvalidOperationExceptionThrown if this task is already used or as an Awaitable. (ToAwaitable, only available in Unity 2023.1+). |
void OVRTask< TResult >.ValidateDelegateAndThrow ( object @ delegate, string paramName ) |
---|
No description available.
|
void OVRTask< TResult >.Dispose ( ) |
---|
Disposes of the task. Invalidate this object but does not cancel the task. In the case where the result will not actually be consumed, it must be called to prevent a memory leak. You can not call GetResult nor use await on a disposed task. |
bool OVRTask< TResult >.Equals ( OVRTask< TResult > other ) |
---|
No description available.
|
override bool OVRTask< TResult >.Equals ( object obj ) |
---|
No description available.
|
override int OVRTask< TResult >.GetHashCode ( ) |
---|
No description available.
|
override string OVRTask< TResult >.ToString ( ) |
---|
No description available.
|