SchedulerTask<T> class
abstract
Represents a unit of work scheduled in the BloomScheduler queue.
Provides handles for querying status, awaiting completion via future, or cancelling the task prior to execution via cancel.
final task = BloomScheduler.schedule(
() => fetchSuggestions(query),
priority: TaskPriority.low,
);
// Cancel if the user types a new character before execution:
if (queryChanged) {
task.cancel();
}
Constructors
Properties
-
future
→ Future<
T> -
A future resolving when the task execution completes, or completing with an error.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → int
-
Unique identifier assigned to this task instance.
no setter
- isCancelled → bool
-
Whether this task was cancelled before completion.
no setter
- isCompleted → bool
-
Whether this task has finished execution (completed successfully, errored, or cancelled).
no setter
- priority → TaskPriority
-
The assigned priority level of this task.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancel(
) → void - Cancels this task if it has not yet started or completed.
-
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