Class Future
Represents lightweight version of Task.
Inherited Members
Namespace: DotNext.Threading.Tasks
Assembly: DotNext.dll
Syntax
public abstract class Future : IFuture, INotifyCompletion
Remarks
This data type is primarily used for bridging between synchronous or legacy asynchronous code into
await
-friendly form. It is NOT a replacement of Task in general.
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. |
Properties
| Improve this Doc View SourceIsCompleted
Determines whether asynchronous operation referenced by this object is already completed.
Declaration
public abstract bool IsCompleted { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
| Improve this Doc View SourceComplete()
Moves this Future into completed state and execute all attached continuations.
Declaration
protected void Complete()
OnCompleted(Action)
Attaches the callback that will be invoked on completion.
Declaration
public void OnCompleted(Action callback)
Parameters
Type | Name | Description |
---|---|---|
Action | callback | The callback to be attached to the asynchronous operation which result is represented by this awaitable object. |
Implements
Extension Methods
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>)