Class Future<T>
Represents Future pattern that can be converted into
Namespace: DotNext.Threading.Tasks
Assembly: DotNext.dll
Syntax
public abstract class Future<T> : Future, IFuture, INotifyCompletion where T : Task
Type Parameters
| Name | Description |
|---|---|
| T | The type of task that is supported by awaitable object. |
Constructors
| Improve this Doc View SourceFuture(Boolean)
Initializes a new Future.
Declaration
protected Future(bool runContinuationsAsynchronously = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | runContinuationsAsynchronously | true to force continuations to run asynchronously; otherwise, false. |
Methods
| Improve this Doc View SourceAsTask()
Converts this awaitable object into task of type T.
Declaration
public abstract T AsTask()
Returns
| Type | Description |
|---|---|
| T | The task representing the current awaitable object. |
Remarks
This method can cause extra allocation of memory. Do not use it for await scenario.
It is suitable only for interop with
Implements
INotifyCompletion