Class FutureExtensions
Windows only Future extensions
Inheritance
System.Object
FutureExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public static class FutureExtensions
Methods
AsPromise(Task)
Converts a .NET Task to a promise.
Declaration
public static Promise<object> AsPromise(this Task task)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Tasks.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 |
---|---|---|
System.Threading.Tasks.Task<T> | task | The task. |
Returns
Type | Description |
---|---|
Promise<T> |
Type Parameters
Name | Description |
---|---|
T |
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 |
---|---|---|
System.Threading.Tasks.Task<T> | task | The task. |
Returns
Type | Description |
---|---|
Promise<Unit<T>> |
Type Parameters
Name | Description |
---|---|
T |
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 | Description |
---|---|
System.Threading.Tasks.Task<T> |
Type Parameters
Name | Description |
---|---|
T |
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. |
System.Threading.Tasks.TaskCreationOptions | creationOptions | The task creation options. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> |
Type Parameters
Name | Description |
---|---|
T |
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 |
---|---|
System.Runtime.CompilerServices.TaskAwaiter<T> |
Type Parameters
Name | Description |
---|---|
T |