Input gate
This actor is one JavaScript thread. While it waits on SQLite, Cloudflare does not start the next request. When it waits on Workers AI, that hold lifts, and another update can read the same counter before this one writes.
What this shows A few updates read one counter, wait on Workers AI, and write back. The mailbox lines them up. An open input gate lets them overwrite each other.
Each racer reads the counter, awaits the model, then writes read + 1.
Expected0
Actual0
Lost0
Fire a run to see who read the counter, who waited, and who wrote back.
| Racer | Read | Wait | Wrote |
|---|
Hibernating WebSocket. Messages are SQLite. Scratch is isolate memory and also disappears when the room hibernates after about 10 seconds with no messages.
This actor is one JavaScript thread. While it waits on SQLite, Cloudflare does not start the next request. When it waits on Workers AI, that hold lifts, and another update can read the same counter before this one writes.
The response stays here until the SQLite write is confirmed. If the actor is evicted first, the write rolls back and the caller gets an error instead of a success that never landed.
Serialized mode is the durable-actors default: handlers take a number and run one at a time, even during the model wait. Interleaved mode is their @Interleave opt-out. blockConcurrencyWhile keeps the input gate shut for a whole wait. This actor uses it only while loading SQLite. Holding it across Workers AI would stall every other event for as long as the model takes, so the mailbox does that job instead.