TaskBatchBase<T extends Object> class
abstract
Provides a foundational structure for managing a collection of tasks.
This class handles queue management and provides guards to prevent unsafe modifications. Subclasses are responsible for implementing the execution strategy (e.g., sequential or concurrent).
Constructors
Properties
- executionCount → int
-
The total number of tasks to be executed in the current batch.
no setter
- executionIndex → int
-
The index of the currently executing task. Zero-based.
no setter
- executionProgress → double
-
The execution progress as a value between 0.0 and 1.0.
Returns 0.0 if
executionCount
is zero.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- isExecuting → bool
-
Indicates if the batch is actively processing tasks.
no setter
- isNotExecuting → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
tasks
↔ Queue<
Task< T> > -
A protected queue of tasks awaiting processing, typically in FIFO order.
getter/setter pair
Methods
-
add(
TTaskHandler< T> handler, {TOnTaskError? onError, bool? eagerError, Duration? minTaskDuration}) → void - A convenience method to construct a Task and add it to the queue.
-
addAllTasks(
Iterable< Task< newTasks) → voidT> > - Adds multiple Task objects to the end of the queue.
-
addTask(
Task< T> task) → void - Adds a pre-configured Task to the end of the queue.
-
clearTasks(
) → bool - Clears all tasks from the queue.
-
executeTasks(
) → TResolvableOption< T> - Defines the task execution strategy for the batch.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeFirstTask(
) → bool - Removes the first task from the queue.
-
removeLastTask(
) → bool - Removes the last task from the queue.
-
removeTask(
Task< T> task) → bool -
Removes a specific
task
from the queue. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited