EventConcurrency enum
How same-type events are processed relative to one another.
Juice dispatches each event independently, so without a policy two events of
the same type can interleave at every await inside a use case (the
"read state before an await, write a stale value after" race). Declare a
mode per event on its UseCaseBuilder to control this.
Values
- concurrent → const EventConcurrency
-
Default — same-type use cases may run concurrently (interleave at awaits). Use for genuinely independent events; follow the read-at-emit discipline.
- sequential → const EventConcurrency
-
Same-type events queue and run one at a time, in order; each use case completes (including its awaits) before the next starts. Eliminates the read-before-await race for that event type.
- droppable → const EventConcurrency
-
A same-type event arriving while one is already running is dropped. Replaces hand-rolled "busy" guard flags for exclusive flows.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - 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
Constants
-
values
→ const List<
EventConcurrency> - A constant List of the values in this enum, in order of their declaration.