IsolatedWork<T> class

A IsolatedWork is an operation for executing a computation inside the Isolate container with the possibility of externally controlled termination.

Implemented types

Constructors

IsolatedWork(FutureOr<T> computation(), {CancellationToken? token})
Creates an instance of IsolatedWork.

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 if the terminate method was called before the computation was completed.
override
terminate({bool force = false}) → void
Requests to terminate the execution of a computation.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

withArgument<T, R>(T argument, FutureOr<R> computation(T arg), {CancellationToken? token}) IsolatedWork<R>
Creates an instance of ZonedWork.