Concurrency mode rulings — examples and teaching code (2026-09-30)

2.0 docket item B, step 1. SIGNED by Kevin 2026-10-07 (“as recommended”) and APPLIED the same day — every site below now declares the mode in this table; the 58 core test sites and the two built-in UpdateEvent sites declare concurrent; 25 teaching snippets in the docs declare the mode the same rules give (loads, fetches and connections droppable, mutations sequential). juice_missing_concurrency_mode is ON in the five canary apps (it fired on 9 bare sites in notes_app before the sweep, zero after) and the lint:juice gate enforces it. Every builder site in the family ran concurrent before this; 2.0 makes the mode a required parameter. The rulings were made from what each use case does.

Gate honesty: the five juice_examples apps have NO test suites, so the 113 behaviour changes in them are covered only by analysis and the lint gate. The root showcase (24 tests), the network and auth_network examples, core (515) and the benchmarks (17) are green.

121 sites: 90 sequential, 23 droppable, 8 concurrent.

The rules applied

rule mode when
mutate, no await sequential the use case reads and writes bloc state with no await. Atomic either way; ruled sequential because the family’s own packages rule these sequential (47 of 55 such sites) and it stays correct if an await is added later
mutate across an await sequential persist-then-write, or append to a list: order matters and the read-before-await race is impossible
latest input wins restartable (since 2.0.0; sequential until then) search, filter, select, load-by-id. The new input supersedes the in-flight run: its emissions are fenced, its bindings cancelled, a cancellable event cancelled. droppable would drop the NEWER input; concurrent lets an older response land last; sequential (the 1.x ruling) ran every superseded request to completion. These eight sites were the consumers restartable (#3) waited for; re-ruled 2026-10-07 on the v2 branch
exclusive flow droppable init, load, refresh, submit, checkout: a second one while the first runs is redundant
independent concurrent nothing shared to order; stated per site

What changes at run time

Every site runs concurrent today, so every ruling other than concurrent changes behaviour in the example it touches:

  • sequential queues same-type events and runs the whole use case, its emit included, behind the previous one. A use case with no await emits one microtask later than it does today.
  • droppable drops a same-type event that arrives while one is running.
  • Gate: each app’s own test suite, plus the juice_lint gate with the missing-mode rule ON reporting zero.

Judgment calls worth your eye

  1. Latest-input-wins ruled sequential, not concurrent with a stale guard. It wastes the superseded requests but cannot show stale data.
  2. ManualSaveEvent sequential, not droppable: a save asked for during a save reads newer content and must still run.
  3. AutoSaveEvent and TickEvent concurrent: execute only arms a timer; the mode has nothing to order.
  4. Load-more droppable leaves the hand-rolled isLoadingMore guard in place (it also checks hasReachedEnd). Removing the redundant half is a separate change.
  5. UploadFileEvent droppable: the state holds one file.
  6. The coalescing demo stays concurrent: overlap is what it shows.
  7. Tests (58 sites in core) are not in this table: they declare concurrent verbatim, preserving what each test runs today (ruling 4). The two core sites (UpdateEvent built-ins) declare concurrent (ruling 2).

benchmarks/ — 1 sites (1 concurrent)

event builder awaits mode why
_Ev breakdown.dart:67 Stateful 0 concurrent the benchmark measures the path _FreshBloc already declares; same mode keeps the two rows comparable

Root showcase app (example/) — 45 sites (39 sequential, 6 droppable)

event builder awaits mode why
LoginEvent blocs/auth/auth_bloc.dart:12 plain 1 droppable exclusive flow: a second one while the first runs is redundant
LogoutEvent blocs/auth/auth_bloc.dart:16 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ConnectWebSocketEvent blocs/chat/chat_bloc.dart:13 Stateful 7 droppable exclusive flow: a second one while the first runs is redundant
SendMessageEvent blocs/chat/chat_bloc.dart:19 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ReceiveMessageEvent blocs/chat/chat_bloc.dart:22 plain 1 sequential mutates shared state across an await (persist, then write)
IncrementEvent blocs/counter/counter_bloc.dart:13 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
DecrementEvent blocs/counter/counter_bloc.dart:16 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ResetEvent blocs/counter/counter_bloc.dart:19 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ShowcaseIncrementEvent blocs/features_showcase/features_showcase_bloc.dart:25 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ShowcaseDecrementEvent blocs/features_showcase/features_showcase_bloc.dart:29 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
SimulateApiCallEvent blocs/features_showcase/features_showcase_bloc.dart:34 plain 1 sequential mutates shared state across an await (persist, then write)
ValidateInputEvent blocs/features_showcase/features_showcase_bloc.dart:39 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
UpdateMessageEvent blocs/features_showcase/features_showcase_bloc.dart:44 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ClearErrorEvent blocs/features_showcase/features_showcase_bloc.dart:49 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ShowcaseResetEvent blocs/features_showcase/features_showcase_bloc.dart:53 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
UploadFileEvent blocs/file_upload/src/file_upload_bloc.dart:10 plain 1 droppable one upload at a time: the state holds a single file; cancel, then send again
SubmitFormEvent blocs/form/form_bloc.dart:10 plain 1 droppable exclusive flow: a double submit must not run twice
StartDemoEvent blocs/lifecycle_demo/lifecycle_demo_bloc.dart:31 plain 1 droppable exclusive flow: a second one while the first runs is redundant
EndDemoEvent blocs/lifecycle_demo/lifecycle_demo_bloc.dart:35 plain 1 droppable exclusive flow: a second one while the first runs is redundant
ToggleSlowCleanupEvent blocs/lifecycle_demo/lifecycle_demo_bloc.dart:39 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
UpdateTaskProgressEvent blocs/lifecycle_demo/lifecycle_demo_bloc.dart:43 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
TaskCompletedEvent blocs/lifecycle_demo/lifecycle_demo_bloc.dart:47 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
CancelAllTasksEvent blocs/lifecycle_demo/lifecycle_demo_bloc.dart:51 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
AddLogEvent blocs/lifecycle_demo/lifecycle_demo_bloc.dart:55 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ScopeEndingEvent blocs/lifecycle_demo/lifecycle_demo_bloc.dart:59 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ScopeEndedEvent blocs/lifecycle_demo/lifecycle_demo_bloc.dart:63 plain 1 sequential mutates shared state across an await (persist, then write)
UpdateDemoStateEvent blocs/lifecycle_demo/lifecycle_demo_bloc.dart:67 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ResetDemoEvent blocs/lifecycle_demo/lifecycle_demo_bloc.dart:71 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
NextPageEvent blocs/onboard/onboard_bloc.dart:9 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
StateRelayedEvent blocs/relay_demo/dest_bloc.dart:13 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
StatusUpdatingEvent blocs/relay_demo/dest_bloc.dart:17 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
StatusWaitingEvent blocs/relay_demo/dest_bloc.dart:21 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
StatusFailedEvent blocs/relay_demo/dest_bloc.dart:25 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ClearLogEvent blocs/relay_demo/dest_bloc.dart:29 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
IncrementSourceEvent blocs/relay_demo/source_bloc.dart:13 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
DecrementSourceEvent blocs/relay_demo/source_bloc.dart:17 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
SimulateAsyncEvent blocs/relay_demo/source_bloc.dart:21 plain 1 sequential mutates shared state across an await (persist, then write)
SimulateErrorEvent blocs/relay_demo/source_bloc.dart:25 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ResetSourceEvent blocs/relay_demo/source_bloc.dart:29 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ToggleTemperatureUnitEvent blocs/settings/settings_bloc.dart:10 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
AddTodoEvent blocs/todo/todo_bloc.dart:14 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
UpdateTodoEvent blocs/todo/todo_bloc.dart:17 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
RemoveTodoEvent blocs/todo/todo_bloc.dart:20 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ToggleTodoEvent blocs/todo/todo_bloc.dart:23 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
FetchWeatherEvent blocs/weather/weather_bloc.dart:10 plain 1 restartable (2.0.0; was sequential) latest input must win: the new input supersedes the in-flight run (#3, built 2026-10-07)

packages/juice/example — 3 sites (2 sequential, 1 concurrent)

event builder awaits mode why
IncrementEvent packages/juice/example/example.dart:46 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
DecrementEvent packages/juice/example/example.dart:50 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
RefreshRowEvent packages/juice/example/example.dart:155 plain 1 concurrent independent per row: guardEntity tracks each row’s own status

packages/juice_auth_network/example — 1 sites (1 droppable)

event builder awaits mode why
LoadProfileEvent profile_bloc.dart:114 plain 1 droppable exclusive flow: a second one while the first runs is redundant

juice_examples · chat_app — 7 sites (6 sequential, 1 droppable)

event builder awaits mode why
LoadMessagesEvent blocs/chat_bloc.dart:21 plain 1 restartable (2.0.0; was sequential) latest input must win: the new input supersedes the in-flight run (#3, built 2026-10-07)
SendMessageEvent blocs/chat_bloc.dart:25 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ReceiveMessageEvent blocs/chat_bloc.dart:29 plain 1 sequential mutates shared state across an await (persist, then write)
UpdateTypingEvent blocs/chat_bloc.dart:33 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
LoadContactsEvent blocs/contacts_bloc.dart:15 plain 0 droppable exclusive flow: a second one while the first runs is redundant
UpdateContactStatusEvent blocs/contacts_bloc.dart:20 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
UpdateContactLastMessageEvent blocs/contacts_bloc.dart:24 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)

juice_examples · dashboard — 4 sites (3 droppable, 1 sequential)

event builder awaits mode why
LoadAnalyticsEvent blocs/analytics_bloc.dart:12 plain 1 droppable exclusive flow: a second one while the first runs is redundant
FilterDataEvent blocs/analytics_bloc.dart:17 plain 1 restartable (2.0.0; was sequential) latest input must win: the new input supersedes the in-flight run (#3, built 2026-10-07)
LoadDashboardEvent blocs/dashboard_bloc.dart:12 plain 1 droppable exclusive flow: a second one while the first runs is redundant
RefreshStatsEvent blocs/dashboard_bloc.dart:17 plain 1 droppable exclusive flow: a second one while the first runs is redundant

juice_examples · ecommerce — 10 sites (6 sequential, 4 droppable)

event builder awaits mode why
LoadCartEvent blocs/cart_bloc.dart:13 plain 1 droppable exclusive flow: a second one while the first runs is redundant
AddToCartEvent blocs/cart_bloc.dart:18 plain 2 sequential mutates shared state across an await (persist, then write)
RemoveFromCartEvent blocs/cart_bloc.dart:22 plain 2 sequential mutates shared state across an await (persist, then write)
UpdateCartQuantityEvent blocs/cart_bloc.dart:26 plain 1 sequential mutates shared state across an await (persist, then write)
CheckoutEvent blocs/cart_bloc.dart:30 plain 2 droppable exclusive flow: a double checkout must not run twice
LoadProductsEvent blocs/products_bloc.dart:16 plain 1 restartable (2.0.0; was sequential) latest input must win: the new input supersedes the in-flight run (#3, built 2026-10-07)
LoadCategoriesEvent blocs/products_bloc.dart:21 plain 1 droppable exclusive flow: a second one while the first runs is redundant
LoadMoreProductsEvent blocs/products_bloc.dart:26 plain 1 droppable exclusive flow: replaces the hand-rolled isLoadingMore guard
SearchProductsEvent blocs/products_bloc.dart:30 plain 1 restartable (2.0.0; was sequential) latest input must win: the new input supersedes the in-flight run (#3, built 2026-10-07)
LoadProductDetailEvent blocs/products_bloc.dart:34 plain 1 restartable (2.0.0; was sequential) latest input must win: the new input supersedes the in-flight run (#3, built 2026-10-07)

juice_examples · notes_app — 18 sites (14 sequential, 3 droppable, 1 concurrent)

event builder awaits mode why
InitEditorEvent blocs/editor/editor_bloc.dart:27 Inline 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
UpdateContentEvent blocs/editor/editor_bloc.dart:52 Inline 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ChangeEditorColorEvent blocs/editor/editor_bloc.dart:76 Inline 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
AutoSaveEvent blocs/editor/editor_bloc.dart:94 Stateful 1 concurrent execute only re-arms a debounce timer; every event must be seen and there is nothing to order (the save reads state when the timer fires)
ManualSaveEvent blocs/editor/editor_bloc.dart:100 plain 2 sequential a save requested during a save must still run: it reads the newer content
LoadNotesEvent blocs/notes/notes_bloc.dart:29 plain 4 droppable exclusive flow: a second one while the first runs is redundant
SaveNoteEvent blocs/notes/notes_bloc.dart:36 plain 1 sequential mutates shared state across an await (persist, then write)
SearchNotesEvent blocs/notes/notes_bloc.dart:44 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
TogglePinEvent blocs/notes/notes_bloc.dart:50 Inline 1 sequential mutates shared state across an await (persist, then write)
ChangeNoteColorEvent blocs/notes/notes_bloc.dart:69 Inline 1 sequential mutates shared state across an await (persist, then write)
MoveToTrashEvent blocs/notes/notes_bloc.dart:88 plain 2 sequential mutates shared state across an await (persist, then write)
RestoreFromTrashEvent blocs/notes/notes_bloc.dart:94 plain 2 sequential mutates shared state across an await (persist, then write)
EmptyTrashEvent blocs/notes/notes_bloc.dart:100 plain 1 droppable exclusive bulk operation
PermanentDeleteEvent blocs/notes/notes_bloc.dart:106 plain 1 sequential mutates shared state across an await (persist, then write)
SettingsChangedEvent blocs/notes/notes_bloc.dart:112 Inline 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
LoadSettingsEvent blocs/settings/settings_bloc.dart:25 plain 2 droppable exclusive flow: a second one while the first runs is redundant
ToggleViewModeEvent blocs/settings/settings_bloc.dart:32 Inline 1 sequential mutates shared state across an await (persist, then write)
ChangeSortOrderEvent blocs/settings/settings_bloc.dart:49 Inline 1 sequential mutates shared state across an await (persist, then write)

juice_examples · social_feed — 6 sites (3 droppable, 3 sequential)

event builder awaits mode why
LoadFeedEvent blocs/feed_bloc.dart:18 plain 1 droppable exclusive flow: a second one while the first runs is redundant
LoadMoreEvent blocs/feed_bloc.dart:23 plain 1 droppable exclusive flow: replaces the hand-rolled isLoadingMore guard
LikePostEvent blocs/feed_bloc.dart:27 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
AddCommentEvent blocs/feed_bloc.dart:31 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
SelectPostEvent blocs/feed_bloc.dart:35 plain 1 restartable (2.0.0; was sequential) latest input must win: the new input supersedes the in-flight run (#3, built 2026-10-07)
LoadProfileEvent blocs/profile_bloc.dart:14 plain 1 droppable exclusive flow: a second one while the first runs is redundant

packages/juice_network/example — 16 sites (11 sequential, 4 concurrent, 1 droppable)

event builder awaits mode why
FireRequestEvent blocs/coalesce_bloc.dart:171 plain 1 concurrent the demo IS overlapping same-type requests: coalescing only shows when they run together
FireBurstEvent blocs/coalesce_bloc.dart:175 plain 1 concurrent the demo IS overlapping same-type requests: coalescing only shows when they run together
ResetCoalesceEvent blocs/coalesce_bloc.dart:179 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ConfigureInterceptorsEvent blocs/interceptors_bloc.dart:211 plain 1 sequential mutates shared state across an await (persist, then write)
ToggleLoggingEvent blocs/interceptors_bloc.dart:216 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ToggleAuthEvent blocs/interceptors_bloc.dart:220 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
ToggleTimingEvent blocs/interceptors_bloc.dart:224 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
MakeRequestEvent blocs/interceptors_bloc.dart:228 plain 1 concurrent independent requests; the use case writes no state
MakeFailingRequestEvent blocs/interceptors_bloc.dart:232 plain 1 concurrent independent requests; the use case writes no state
ClearLogsEvent blocs/interceptors_bloc.dart:236 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
AddLogEvent blocs/interceptors_bloc.dart:240 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
LoadPostsEvent blocs/posts_bloc.dart:238 plain 1 droppable exclusive flow: a second one while the first runs is redundant
SetCachePolicyEvent blocs/posts_bloc.dart:243 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
LoadPostDetailEvent blocs/posts_bloc.dart:247 plain 1 restartable (2.0.0; was sequential) latest input must win: the new input supersedes the in-flight run (#3, built 2026-10-07)
DeletePostEvent blocs/posts_bloc.dart:251 plain 1 sequential mutates shared state across an await (persist, then write)
ClearPostDetailEvent blocs/posts_bloc.dart:255 plain 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)

packages/juice_storage/example — 10 sites (8 sequential, 1 droppable, 1 concurrent)

event builder awaits mode why
UpdateKeyEvent blocs/arcade_demo_bloc.dart:37 Inline 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
UpdateValueEvent blocs/arcade_demo_bloc.dart:46 Inline 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
SelectBackendEvent blocs/arcade_demo_bloc.dart:56 Inline 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
UpdateTtlEvent blocs/arcade_demo_bloc.dart:67 Inline 0 sequential mutates bloc state with no await; the family’s own packages rule these sequential (47 of 55)
SaveEntryEvent blocs/arcade_demo_bloc.dart:78 plain 5 sequential mutates shared state across an await (persist, then write)
ReadEntryEvent blocs/arcade_demo_bloc.dart:82 plain 4 sequential mutates shared state across an await (persist, then write)
DeleteEntryEvent blocs/arcade_demo_bloc.dart:86 plain 4 sequential mutates shared state across an await (persist, then write)
SpawnBombsEvent blocs/arcade_demo_bloc.dart:90 plain 2 sequential mutates shared state across an await (persist, then write)
CleanupCacheEvent blocs/arcade_demo_bloc.dart:94 plain 1 droppable exclusive flow: one sweep at a time
TickEvent blocs/arcade_demo_bloc.dart:100 Stateful 0 concurrent execute only arms a periodic timer once (_timer ??=); nothing to order

This site uses Just the Docs, a documentation theme for Jekyll.