Class FutureExtensions
Windows only Future extensions
Inheritance
System.Object
FutureExtensions
Namespace: FM.LiveSwitch
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 | 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 |
---|---|---|
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 |
---|---|
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. |
TaskCreationOptions | creationOptions | The task creation options. |
Returns
Type | Description |
---|---|
Task<T> |
Type Parameters
Name | Description |
---|---|
T |