taskflow library
Classes
- ConcurrencyControl
- Concurrency control to limit parallel task executions.
- CronSchedule
- Cron-style scheduling for periodic tasks.
- DedupPolicy
- Task deduplication policy to prevent duplicate enqueues.
- RateLimit
- Rate limiting configuration.
- RetryPolicy
- Base class for retry policies. Defines when and how to retry a failed task.
- TaskBatch
- Batch of tasks with lifecycle callbacks.
- TaskCancelled
- Task was cancelled by user request.
- TaskChain
- Fluent builder for task chains.
- TaskConstraints
- Constraints that must be satisfied before a background task executes.
- TaskContext
- Context passed to a task handler when it executes.
- TaskEncryption
- Task data encryption at rest.
- TaskFailed
- Task failed after exhausting retries.
- TaskFailure
- Task failed.
- TaskFlow
- Main API for TaskFlow. All methods are static.
- TaskHistoryEntry
- Record of a single task execution.
- TaskHooks
- Global lifecycle hooks for task execution.
- TaskInfo
- Information about a registered or queued task.
- TaskMiddleware
- Signature for middleware that wraps task execution.
- TaskQueued
- Task has been queued but not yet executed.
- TaskRegistry
- Registry of task handlers. Singleton.
- TaskResult
- Result of executing a background task handler.
- TaskRetrying
- Task failed but will retry after nextAttempt.
- TaskRetryLater
- Task should retry after a custom delay.
- TaskRunning
- Task is currently running.
- TaskStatus
- Status of a task execution. Sealed for exhaustive pattern matching.
- TaskSucceeded
- Task completed successfully.
- TaskSuccess
- Task completed successfully.
- TaskTimeout
- Task timeout configuration with soft and hard limits.
- TimeWindow
- Time window constraint for when tasks can run.
Enums
- ConcurrencyStrategy
- Strategy for selecting which tasks to execute when at concurrency limit
- NetworkConstraint
- Network requirement constraint for a background task.
- TaskPriority
- Priority level for a background task.
- TaskQueue
- Named task queues with weighted priority.
- UniquePolicy
-
Policy for handling duplicate task enqueues with the same
uniqueId.
Typedefs
-
TaskFlowDispatcher
= Future<
TaskResult> Function(String taskName, Map<String, dynamic> input, int attempt, String executionId) - Signature for the dispatcher function passed to TaskFlow.initialize.
-
TaskHandler
= Future<
TaskResult> Function(TaskContext context) - Signature for a task handler function.
Exceptions / Errors
- TaskFlowChainCycleException
- Thrown when a task chain definition has circular dependencies.
- TaskFlowDataSizeException
- Thrown when input/output data exceeds platform limits.
- TaskFlowException
- Base exception for all taskflow errors.
- TaskFlowNotInitializedException
- Thrown when any TaskFlow API is called before TaskFlow.initialize.
- TaskHandlerNotFoundException
- Thrown when TaskFlow.enqueue references a handler that was not registered.