AsyncTask<P, R> class
abstract
Base class for tasks implementation.
P
is the parameters type.R
is the result type.
Constructors
Properties
- endTime → DateTime?
-
The execution end time.
no setter
- error → dynamic
-
The error, after the task execution is finished.
no setter
- executionTime → Duration?
-
no setter
- executorThread → AsyncExecutorThread?
-
no setter
- hasError → bool
-
Returns
true
if this task execution has finished with an error.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- initTime → DateTime?
-
The execution initial time.
no setter
- isFinished → bool
-
Returns
true
if this task execution has finished.no setter - isIdle → bool
-
Returns
true
if this task has NOT yet been submitted.no setter - isInExecutionContext → bool
-
if
true
, indicates that the current context is inside AsyncTask.run.no setter - isNotFinished → bool
-
Returns
true
if this task execution has NOT finished.no setter - isSuccessful → bool
-
Returns
true
if this task execution has finished successfully.no setter - result → R?
-
The result, after the task execution is finished.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → AsyncTaskStatus
-
The current status.
no setter
- submitTime ↔ DateTime?
-
The submit time.
getter/setter pair
- taskType → String
-
no setter
- wasSubmitted → bool
-
Returns
true
if this task has been submitted.no setter - zone → Zone
-
The original Zone where this AsyncTask instance was created.
no setter
Methods
-
addOnFinishAsyncTask(
OnFinishAsyncTask onFinishAsyncTask) → void - Adds a trigger to be called when this tasks finishes.
-
channel(
) → FutureOr< AsyncTaskChannel?> - Returns an optional AsyncTaskChannel for communication with the task.
-
channelInstantiator(
) → AsyncTaskChannel? - Instantiate the optional AsyncTaskChannel return by channel.
-
channelResolved(
) → AsyncTaskChannel? - Returns an optional AsyncTaskChannel. If not resolved yet will return null.
-
copy(
) → AsyncTask< P, R> - Creates a copy of this task in its initial state (before execution state).
-
execute(
) → FutureOr< R> - Executes this tasks immediately.
-
executeAndCast<
T> () → FutureOr< T> -
Alias for execute, casting the result to
T
. -
instantiate(
P parameters, [ ]) → AsyncTask< P, R> -
Creates an instance of this task type with
parameters
and optionalsharedData
. -
Load of a
SharedData
serial
for the correspondingkey
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parameters(
) → P - The parameters of this tasks.
-
reset(
) → void - Resets this task to it's initial state, before any execution.
-
resolveChannel(
void initializer(AsyncTask task, AsyncTaskChannel channel)) → AsyncTaskChannel? - Resolves the channel instance. Called by AsyncExecutor when executing this task.
-
run(
) → FutureOr< R> - Computes/runs this task.
- Returns an optional Map of SharedData, where each entry will be transferred to the executor thread/isolate only once.
-
toString(
) → String -
A string representation of this object.
override
-
waitResult(
) → Future< R> - Returns a Future to wait for the task result.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited