CancellableFuture<T> class
A class for creating cancellable futures.
For a shortcut to create a cancellable future, use CancellableFutureExtension.asCancellable.
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
delayed<
T> (Duration duration, CancellationToken? cancellationToken, [FutureOr< T> computation()?, OnCancelCallback? onCancel]) → Future<T> - Creates a future that runs its computation after a delay, unless cancelled.
-
from<
T> (FutureOr< T> computation(), CancellationToken? cancellationToken, {OnCancelCallback? onCancel}) → Future<T> -
Creates a cancellable future containing the result of calling
computation
asynchronously with Timer.run. -
microtask<
T> (FutureOr< T> computation(), CancellationToken? cancellationToken, {OnCancelCallback? onCancel}) → Future<T> -
Creates a cancellable future containing the result of calling
computation
asynchronously with scheduleMicrotask. -
sync<
T> (FutureOr< T> computation(), CancellationToken? cancellationToken, {OnCancelCallback? onCancel}) → Future<T> -
Returns a future containing the result of immediately calling
computation
, unless cancelled. -
value<
T> (FutureOr< T> value, CancellationToken? cancellationToken, {OnCancelCallback? onCancel}) → Future<T> - Returns a future that completes with the given value, unless cancelled.