Main API for TaskFlow. All methods are static.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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
Static Methods
-
batch<
T> (String taskName, {required List< T> items, Map<String, dynamic> input = const {}, TaskConstraints? constraints, RetryPolicy? retry, TaskPriority priority = TaskPriority.normal}) → Future<TaskBatch> - Batch enqueue multiple items as a single trackable unit.
-
cancel(
String name) → Future< void> - Cancels all executions of a task by name.
-
cancelAll(
) → Future< void> - Cancels all tasks.
-
cancelByTag(
String tag) → Future< void> - Cancels all tasks with a given tag.
-
cancelChain(
String chainId) → Future< void> - Cancels an entire task chain.
-
cancelExecution(
String executionId) → Future< void> - Cancels a specific task execution.
-
chain(
String id) → TaskChain - Starts building a task chain.
-
enqueue(
String name, {Map< String, dynamic> input = const {}, TaskConstraints? constraints, RetryPolicy? retry, TaskPriority priority = TaskPriority.normal, List<String> tags = const [], Duration? initialDelay, String? uniqueId, UniquePolicy? uniquePolicy, TaskTimeout? timeout, DedupPolicy? dedupPolicy, ConcurrencyControl? concurrency, RateLimit? rateLimit, TaskQueue queue = TaskQueue.default_, TaskEncryption? encryption, TimeWindow? window}) → Future<String> - Enqueues a one-off task for execution with advanced options.
-
getAllTasks(
) → Future< List< TaskInfo> > - Gets all registered tasks.
-
getHistory(
String taskName, {int limit = 50, String? status, DateTime? sinceDate}) → Future< List< TaskHistoryEntry> > - Gets execution history for a task (debugging and analytics).
-
getMiddleware(
) → List< TaskMiddleware> - Gets all registered middleware.
-
getStatus(
String name) → Future< TaskStatus?> - Gets the current status of a task by name.
-
getTasksByTag(
String tag) → Future< List< TaskInfo> > - Gets all tasks with a given tag.
-
initialize(
{TaskFlowDispatcher? dispatcher}) → Future< void> - Initializes TaskFlow.
-
monitor(
String name) → Stream< TaskStatus> - Monitors the status of a task by name.
-
monitorExecution(
String executionId) → Stream< TaskStatus> - Monitors the status of a specific task execution.
-
registerHandler(
String name, TaskHandler handler) → void - Registers a handler for a task name.
-
reschedule(
String name, {required Duration interval}) → Future< void> - Reschedules a periodic task with a new interval.
-
schedule(
String name, {Duration? interval, CronSchedule? cron, Map< String, dynamic> input = const {}, TaskConstraints? constraints, RetryPolicy? retry, TaskPriority priority = TaskPriority.normal, Duration? initialDelay, List<String> tags = const [], TimeWindow? window}) → Future<void> - Schedules a periodic task with optional cron expression and time window.
-
startService(
String name, {required String notificationTitle, required String notificationBody, String? notificationIconName, int notificationId = 1001, Duration? updateInterval}) → Future< void> - Starts a persistent background service with foreground notification.
-
stopService(
String name) → Future< void> - Stops a persistent background service.
-
unschedule(
String name) → Future< void> - Stops a periodic task from running.
-
use(
TaskMiddleware middleware) → void - Registers middleware for all task executions.