A job a parent may start: JobContext.run and JobContext.runAll take nothing else.
Job.deferred and JobContext.child make one. An engine declares it on a
job of its own that a parent may run, implements ChildJob<T>. It adds no
start: a parent starts the job through JobContext.run, the engine
through its queue, and a job that waits for a queue stays with the queue. A
job that starts itself is not one: neither Job(body) nor Job.then nor
Job.each makes a child.
Properties
-
done
→ Future<
Outcome< T> > -
Completes with the outcome; never throws.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isCancelled → bool
-
Whether the job has accepted a cancellation, even if the body still runs,
or has ended with one.
no setterinherited
- isChild → bool
-
Whether this job was adopted by a parent — through JobContext.run,
JobContext.runAll or JobContext.each.
no setterinherited
- isFinished → bool
-
Whether outcome is set.
no setterinherited
- isRunning → bool
-
Whether the body is running or its children are still finishing.
no setterinherited
- key → Object?
-
The key given at creation.
no setterinherited
- level → int
-
Nesting depth: 0 for a root job,
parent.level + 1for a child.no setterinherited -
outcome
→ Outcome<
T> ? -
The outcome, or
nulluntil the job is finished.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
value
→ Future<
T> -
Completes with the returned value, or throws Cancelled with the
cancellation stack trace, or throws the body's error.
no setterinherited
Methods
-
cancel(
{CancelReason reason = const ManualCancelReason()}) → Future< void> -
Cancels the job with
reasonand waits for it to actually finish.inherited -
describe(
) → String -
The description given at creation, or an empty string.
inherited
-
ignoreFailure(
) → void -
Tells the core that nobody is interested in this job's failure.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
Creates a handle that finishes with the outcome of this job and cannot
reach it: one branch of a job continued in several.
inherited
-
then<
R> (FutureOr< R> onValue(JobContext ctx, T value), {Object? key, String describe()?, JobObserver? observer}) → Job<R> -
Creates a job that runs
onValueafter this job succeeds and cleans up.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
whenCancelled(
void callback(Cancelled)) → void Function() -
Registers
callbackfor cancellation and returns an unregister function.inherited -
whenFinished(
void callback(Outcome< T> outcome)) → void Function() -
Registers
callbackfor the end of the job and returns an unregister function.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited