Class FutureExtensions
Windows only Future extensions
Inheritance
System.Object
FutureExtensions
Assembly: FM.LiveSwitch.dll
Syntax
public static class FutureExtensions : object
Methods
AsPromise(Task)
Converts a .NET Task to a promise.
Declaration
public static Promise<object> AsPromise(this Task task)
Parameters
Type |
Name |
Description |
Task |
task |
The task.
|
Returns
Type |
Description |
Promise<System.Object> |
|
AsPromise<T>(Task<T>)
Converts a .NET Task to a promise.
Declaration
public static Promise<T> AsPromise<T>(this Task<T> task)
where T : class
Parameters
Type |
Name |
Description |
Task<T> |
task |
The task.
|
Returns
Type Parameters
AsPromisePrimitive<T>(Task<T>)
Converts a .NET Task to a promise.
Declaration
public static Promise<Unit<T>> AsPromisePrimitive<T>(this Task<T> task)
where T : struct
Parameters
Type |
Name |
Description |
Task<T> |
task |
The task.
|
Returns
Type Parameters
AsTask<T>(Future<T>)
Converts a future to a .NET Task.
Declaration
public static Task<T> AsTask<T>(this Future<T> future)
where T : class
Parameters
Type |
Name |
Description |
Future<T> |
future |
The future.
|
Returns
Type Parameters
AsTask<T>(Future<T>, TaskCreationOptions)
Converts a future to a .NET Task with specific task creation options.
Declaration
public static Task<T> AsTask<T>(this Future<T> future, TaskCreationOptions creationOptions)
where T : class
Parameters
Type |
Name |
Description |
Future<T> |
future |
The future.
|
TaskCreationOptions |
creationOptions |
The task creation options.
|
Returns
Type Parameters
AsTaskAsync<T>(Future<T>)
Converts a future to a .NET Task with TaskCreationOptions.RunContinuationsAsynchronously,
which forces continuations added to the task to be executed asynchronously.
Declaration
public static Task<T> AsTaskAsync<T>(this Future<T> future)
where T : class
Parameters
Type |
Name |
Description |
Future<T> |
future |
The future.
|
Returns
Type Parameters
GetAwaiter<T>(Future<T>)
Enables await support for promises. Should not be called directly.
Declaration
public static TaskAwaiter<T> GetAwaiter<T>(this Future<T> future)
where T : class
Parameters
Type |
Name |
Description |
Future<T> |
future |
The future.
|
Returns
Type |
Description |
TaskAwaiter<T> |
|
Type Parameters