SequentialStrategy class

Queues actions and processes them one at a time, preserving order.

Unlike TakeLeading which ignores new actions, this strategy waits for the current action to complete before processing the next one.

Use this strategy when actions must be processed in order and none should be dropped, such as saving operations or sequential API calls.

Example:

b.onWithStrategy<SaveAction>(
  sequential(),
  (state, action) async* {
    await api.save(action.data);
    yield SavedAction();
  },
);
Implemented types
Available extensions

Constructors

SequentialStrategy()
Creates a SequentialStrategy that queues and processes actions in order.

Properties

category StrategyCategory
The category of this strategy, used for validation during chaining.
no setteroverride
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
then(ExecutionStrategy next) ExecutionStrategy

Available on ExecutionStrategy, provided by the ExecutionStrategyChaining extension

Chains this strategy with another strategy.
toString() String
A string representation of this object.
inherited
wrap<S, A extends Action, T extends A>(Stream<A> processor(S state, T action)) Stream<A> Function(S state, T action)
Wraps a processor function with this strategy's behavior.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited