LevitReactiveTasksMixin mixin
Adds reactive task state and selectors to LevitController.
- Superclass constraints
Properties
- autoCleanupDelay → Duration?
-
Optional delay before terminal entries are removed.
no setter
-
disposed
→ Future<
void> -
Completes when cleanup reaches its terminal state.
no setterinherited
-
hasBlockingTasks
→ LxComputed<
bool> -
Whether any active task is marked as blocking.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialized → bool
-
Whether onInit has been executed.
no setterinherited
-
isBusy
→ LxComputed<
bool> -
Whether any latest logical execution is queued or running.
no setter
- isClosed → bool
-
Whether the controller has been disposed and closed.
no setterinherited
- isClosing → bool
-
Whether owner cleanup has started.
no setterinherited
- isDisposed → bool
-
Whether cleanup has completed.
no setterinherited
- isInitialized → bool
-
Whether the initialization phase is complete.
no setterinherited
- maxConcurrentTasks → int
-
Maximum number of concurrent task executions.
no setter
- maxTaskHistory → int
-
Maximum number of terminal logical task entries retained.
no setter
- onTaskError ↔ void Function(Object error, StackTrace stackTrace)?
-
Optional global error handler for tasks in this controller.
getter/setter pair
- onTaskEvent → void Function(LevitTaskEvent event)?
-
Optional controller-local task event observer.
no setter
-
ownedResources
→ Iterable<
Object> -
Resources currently tracked by this owner.
no setterinherited
- ownerPath → String
-
The full owner path within the monitoring system (scopeId:registrationKey).
no setterinherited
- registrationKey → String?
-
The registration key used to identify this instance in Levit.
no setterinherited
- resourceOwnerPath → String
-
A diagnostic owner path applied to otherwise unnamed reactive resources.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scope → LevitScope?
-
The LevitScope that currently owns this controller.
no setterinherited
- taskCacheProvider → LevitTaskCacheProvider?
-
Optional persistent cache provider.
no setter
-
tasks
→ LxMap<
String, TaskDetails> -
Latest execution details keyed by logical task ID.
final
- tasksEngine → LevitTaskEngine
-
The controller-owned task engine.
no setter
-
totalProgress
→ LxComputed<
double> -
Weighted progress across all retained tasks.
no setter
Methods
-
autoDispose<
T> (T object) → T -
Registers
objectfor automatic cleanup when the controller closes.inherited -
cancelAllTasks(
) → void - Cancels all outstanding controller tasks.
-
cancelTask(
String id) → void -
Cancels all outstanding executions for logical
id. -
clearCompleted(
) → void - Clears all terminal tracked entries.
-
clearTask(
String id) → void -
Clears tracked state and cancels outstanding executions for
id. -
didAttachToScope(
LevitScope scope, {String? key}) → void -
Attaches this controller to an owning
scopewith an optional registrationkey.inherited -
isBusyWhere(
{String? category, bool? blocksUserInteraction}) → bool - Whether matching tasks contain any queued or running work.
-
isTaskRunning(
String id) → bool -
Whether logical
idis queued or running. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onClose(
) → FutureOr< void> -
Called when the controller is removed from memory.
override
-
onInit(
) → void -
Called immediately after the controller is initialized.
override
-
own<
T> (T resource) → T -
Registers
resourcefor deterministic cleanup and returns it.inherited -
progressWhere(
{String? category, bool? blocksUserInteraction}) → double - Weighted progress across tasks matching category/blocking filters.
-
refreshOwnedReactivePaths(
) → void -
Reconciles already-owned reactive diagnostics after scope attachment.
inherited
-
runGuardedAsync<
T> (FutureOr< T> action(), {bool cancelOnClose = true, void onError(Object error, StackTrace stackTrace)?}) → Future<T?> -
Executes
actionand suppresses its result if this controller closes first.inherited -
runIsolateTask<
I, T> (LevitIsolateTask< I, T> task, I input, {String? id, TaskPriority priority = TaskPriority.normal, TaskConflictPolicy conflictPolicy = TaskConflictPolicy.reject, int retries = 0, Duration? retryDelay, bool useExponentialBackoff = true, double weight = 1.0, void onError(Object error, StackTrace stackTrace)?, TaskCachePolicy<T> ? cachePolicy, LevitTaskMetadata? metadata, String? debugName}) → Future<T?> - Executes a top-level/static isolate task and tracks its state.
-
runTask<
T> (FutureOr< T> task(LevitTaskContext context), {String? id, TaskPriority priority = TaskPriority.normal, TaskConflictPolicy conflictPolicy = TaskConflictPolicy.reject, int retries = 0, Duration? retryDelay, bool useExponentialBackoff = true, double weight = 1.0, void onError(Object error, StackTrace stackTrace)?, TaskCachePolicy<T> ? cachePolicy, LevitTaskMetadata? metadata, String? debugName}) → Future<T?> -
Executes
taskand tracks the latest execution for its logical ID. -
taskDetails(
String id) → TaskDetails? -
Returns the latest details for logical
id. -
taskProgress(
String id) → double -
Latest progress for logical
id. -
taskStatus<
T> (String id) → LxStatus< T> -
Returns the latest status for
id, or an idle status when absent. -
toString(
) → String -
A string representation of this object.
inherited
-
updateTaskProgress(
String id, double value) → void -
Validates and reports progress for the latest running execution of
id.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited