SequencedTaskBatch<T extends Object> class

A batch of tasks designed to be executed sequentially by a TaskSequencer.

This class holds a collection of Task objects and delegates their execution to a TaskSequencer, ensuring that each task runs only after the previous one has completed.

Inheritance

Constructors

SequencedTaskBatch.new({TaskSequencer<T>? sequencer, TOnTaskConpletedCallback<T>? onTaskCompleted})
SequencedTaskBatch.from(SequencedTaskBatch<T> other, {TaskSequencer<T>? sequencer})
Creates a new batch from an existing one, sharing its configuration.
factory

Properties

executionCount int
The total number of tasks to be executed in the current batch.
no setteroverride
executionIndex int
The index of the currently executing task. Zero-based.
no setteroverride
executionProgress double
The execution progress as a value between 0.0 and 1.0. Returns 0.0 if executionCount is zero.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
isExecuting bool
Indicates if the batch is actively processing tasks.
no setteroverride
isNotExecuting bool
no setterinherited
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 pairinherited

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.
inherited
addAllTasks(Iterable<Task<T>> newTasks) → void
Adds multiple Task objects to the end of the queue.
inherited
addTask(Task<T> task) → void
Adds a pre-configured Task to the end of the queue.
inherited
clearTasks() bool
Clears all tasks from the queue.
inherited
executeTasks() TResolvableOption<T>
Schedules all tasks in the queue for sequential execution.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeFirstTask() bool
Removes the first task from the queue.
inherited
removeLastTask() bool
Removes the last task from the queue.
inherited
removeTask(Task<T> task) bool
Removes a specific task from the queue.
inherited
toString() String
A string representation of this object.
inherited

Operators

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