SequentialEffectHandler<Effect, Msg> class
final
An EffectHandler implementation that ensures effects are handled sequentially.
This handler processes effects one at a time in the order they are received, queuing subsequent effects until the current one has completed. This guarantees that no two effects are handled simultaneously, which is particularly useful when handling effects that depend on shared resources or when maintaining strict processing order is required.
Example:
final sequentialHandler = SequentialEffectHandler(
handler: myEffectHandler,
);
- Implemented types
-
- EffectHandler<
Effect, Msg> - Disposable
- EffectHandler<
- Annotations
-
- @experimental
Constructors
-
SequentialEffectHandler({required EffectHandler<
Effect, Msg> handler}) - Creates a new SequentialEffectHandler.
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
-
call(
Effect effect, MsgEmitter< Msg> emit) → Future<void> -
Queues an effect for processing and starts the processing loop if not already active.
override
-
dispose(
) → Future< void> -
Disposes the handler, clearing the queue.
override
-
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