[ Web Proxy ]
URL:
Viewing: https://firebase.google.com/docs/reference/unity/class/firebase/extensions/task-extension [Back]  [Original]

Firebase.Extensions.TaskExtension Class Reference Skip to main content
Overview Fundamentals AI Build Run Reference Samples
Firebase [Firebase]
Send feedback Stay organized with collections Save and categorize content based on your preferences.

Firebase.Extensions.TaskExtension

Extension methods for System.Threading.Tasks.Task and System.Threading.Tasks.Task < T > that allow the continuation function to be executed on the main thread in Unity.

Summary

This is compatible with both .NET 3.x and .NET 4.x.

To disable these extension methods entirely, uncheck all platform of /Assets/Firebase/Plugins/Firebase.TaskExtension.dll in Unity Editor.

Public static functions

ContinueWithOnMainThread(this Task task, Action< Task > continuation)
Task
Extend Task.
ContinueWithOnMainThread(this Task task, Action< Task > continuation, CancellationToken cancellationToken)
Task
Extend Task.
ContinueWithOnMainThread< T >(this Task< T > task, Action< Task< T >> continuation)
Task
Extend Task < T >.
ContinueWithOnMainThread< TResult >(this Task task, Func< Task, TResult > continuation)
Task< TResult >
Extend Task.
ContinueWithOnMainThread< TResult >(this Task task, Func< Task, TResult > continuation, CancellationToken cancellationToken)
Task< TResult >
Extend Task.
ContinueWithOnMainThread< TResult, T >(this Task< T > task, Func< Task< T >, TResult > continuation)
Task< TResult >
Extend Task < T >.

Public static functions

ContinueWithOnMainThread

Task ContinueWithOnMainThread(
  this Task task,
  Action continuation
)

Extend Task.

Returns a Task which completes once the given task is complete and the given continuation function is called from the main thread in Unity.

Details
Parameters
task
The task to continue with.
continuation
The continuation function to be executed on the main thread once the given task completes.
Returns
A new Task that is complete after the continuation is executed on the main thread.

ContinueWithOnMainThread

Task ContinueWithOnMainThread(
  this Task task,
  Action continuation,
  CancellationToken cancellationToken
)

Extend Task.

Returns a Task which completes once the given task is complete and the given continuation function is called from the main thread in Unity, with a cancellation token.

Details
Parameters
task
The task to continue with.
continuation
The continuation function to be executed on the main thread once the given task completes.
cancellationToken
The cancellation token.
Returns
A new Task that is complete after the continuation is executed on the main thread.

ContinueWithOnMainThread< T >

Task ContinueWithOnMainThread(
  this Task task,
  Action continuation
)

Extend Task < T >.

Returns a Task which completes once the given task is complete and the given continuation function is called from the main thread in Unity.

Details
Template Parameters
T
The Task template type used as an input parameter for the continuation.
Parameters
task
The task to continue with.
continuation
The continuation function to be executed on the main thread once the given task completes.
Returns
A new Task that is complete after the continuation is executed on the main thread.

ContinueWithOnMainThread< TResult >

Task ContinueWithOnMainThread(
  this Task task,
  Func continuation
)

Extend Task.

Returns a Task < TResult > which completes once the given task is complete and the given continuation function with return value TResult is called from the main thread in Unity.

Details
Template Parameters
TResult
The type returned by the continuation.
Parameters
task
The task to continue with.
continuation
The continuation function to be executed on the main thread once the given task completes.
Returns
A new Task of type TResult, that is complete after the continuation is executed on the main thread.

ContinueWithOnMainThread< TResult >

Task ContinueWithOnMainThread(
  this Task task,
  Func continuation,
  CancellationToken cancellationToken
)

Extend Task.

Returns a Task < TResult > which completes once the given task is complete and the given continuation function with return value TResult is called from the main thread in Unity, with a cancellation token.

Details
Template Parameters
TResult
The type returned by the continuation.
Parameters
task
The task to continue with.
continuation
The continuation function to be executed on the main thread once the given task completes.
cancellationToken
The cancellation token.
Returns
A new Task of type TResult, that is complete after the continuation is executed on the main thread.

ContinueWithOnMainThread< TResult, T >

Task ContinueWithOnMainThread(
  this Task task,
  Func continuation
)

Extend Task < T >.

Returns a Task < TResult > which completes once the given task is complete and the given continuation function with return value TResult is called from the main thread in Unity.

Details
Template Parameters
TResult
The return type from continuation and the Task template return type of this extension method. continuation.
T
The Task template type used as an input parameter for the continuation.
Parameters
task
The task to continue with.
continuation
The continuation function to be executed on the main thread once the given task completes.
Returns
A new Task of type TResult, that is complete after the continuation is executed on the main thread.

Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2022-07-27 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-07-27 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page