AsyncExecutor class
Handles async operations with concurrency control and cancellation.
Constructors
- AsyncExecutor({ConcurrencyMode mode = ConcurrencyMode.drop, Duration? maxDuration, bool enabled = true, bool resetOnError = false, bool debugMode = false, String? name, void onMetrics(Duration executionTime)?})
Properties
- currentCallId → int
-
no setter
- debugMode → bool
-
final
- enabled → bool
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasPendingCalls → bool
-
no setter
- isExecuting → bool
-
no setter
- isLocked → bool
-
no setter
- maxDuration → Duration?
-
final
- mode → ConcurrencyMode
-
final
- name → String?
-
final
- onMetrics → void Function(Duration executionTime)?
-
final
- pendingCount → int
-
no setter
- queueSize → int
-
no setter
- resetOnError → bool
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancel(
) → void - Cancel any pending/queued operations.
-
dispose(
) → void - Full cleanup - call in widget dispose.
-
execute(
Future< void> callback()) → Future<bool> - Returns true if this call was executed (not dropped/queued).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void - Reset state (cancel + clear execution state).
-
shouldContinue(
int callId) → bool - Check if a specific call should continue executing.
-
toString(
) → String -
A string representation of this object.
inherited
-
wrap(
Future< void> callback()?) → VoidCallback? - Wrap a nullable callback for use with builder widgets.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited