Work<T> class
abstract
A Work is an operation for executing a computation inside the container with the possibility of externally controlled termination.
- Implementers
Constructors
- Work()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
) → Future< T> - Executes the computation and returns the computation result (or throws the exception), or throws the CancellationException exception.
-
terminate(
{bool force = false}) → void - Requests to terminate the execution of a computation.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create<
T> (FutureOr< T> computation(), {CancellationToken? token}) → Work<T> -
Returns an instance of Work depending on the platform (for
the
nativeplatform it isIsolatedContext, for thewebplatform it isZonedContext). -
createWithArgument<
T, R> (T argument, FutureOr< R> computation(T arg), {CancellationToken? token}) → Work<R> -
Returns an instance of Work depending on the platform (for
the
nativeplatform it isIsolatedContext, for thewebplatform it isZonedContext).