Task<T> class abstract

Base worker task class

Implementers

Constructors

Task()

Properties

hashCode int
The hash code for this object.
no setterinherited
isCancelled bool
Flag indicating whether the task has been cancelled.
no setter
isFinished bool
Flag indicating whether the task has completed.
no setter
isRunning bool
Flag indicating whether the task is actually being executed.
no setter
runningTime Duration
Duration between the moment the task was assigned to a Worker, and the moment it finished executing.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
waitTime Duration
Duration between the moment the task was posted, and the moment it was assigned to a Worker.
no setter

Methods

cancel([String? message]) → void
Cancels the task. If the task is still pending, cancellation is effective immediately with a CancelledException. For a running ValueTask, cancellation is ignored and the task's ValueTask.value will eventually complete. For a running StreamTask, cancellation will be effective after receiving the next value and the task's StreamTask.stream will be closed. It should be noted that cancellation of running tasks will not be notified to platform workers. To give running tasks a chance to get notified of cancellation, a CancellationToken should be passed on to tasks at the time they are created.
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