TaskChain class final
Fluent builder for task chains.
Example:
final chainId = await TaskFlow.chain('my-chain')
.then('step1')
.then('step2')
.thenAll(['step3a', 'step3b'])
.onFailure('handleError')
.enqueue(input: {'key': 'value'});
Properties
- constraints ↔ TaskConstraints?
-
getter/setter pair
- failureName ↔ String?
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
final
- retry ↔ RetryPolicy?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
enqueue(
{Map< String, dynamic> input = const {}}) → Future<String> - Enqueues the chain for execution.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onFailure(
String handlerName) → TaskChain - Registers a failure handler for this chain.
-
then(
String taskName) → TaskChain - Adds a sequential task to the chain.
-
thenAll(
List< String> taskNames) → TaskChain - Adds multiple tasks to run in parallel.
-
toString(
) → String -
A string representation of this object.
inherited
-
withConstraints(
TaskConstraints constraints) → TaskChain - Sets constraints for all steps in the chain.
-
withRetry(
RetryPolicy retry) → TaskChain - Sets retry policy for all steps in the chain.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited