Post #2625595
2026-04-30 17:44 UTC
@mattiem@mastodon.social biggest pain point at scale: order races. Not sure if it needs to be addressed in the language or in specific cases.
One example: rapidly yielding items to an AsyncStream on the main thread (which have an implicit serial order) will not always be vended in order, e.g. in a `for await item in stream` loop running elsewhere.
Generally, there are *some* actor patterns that also want there to be some concept of a serialization layered into the cooperative queue.
Replies (1)
-
@mattiem@mastodon.social 2026-04-30 17:49
@patters@mastodon.social ordering is absolutely a challenge! I have found either a queue or a tool to prevent actor reentrancy (which is fundamentally also a queue internally) to be essential. And I agree that something like this should be in the language/stdlib. It has been discussed! Your AsyncStream example, however, does not sound like normal behavior. Are you sure it wasn't a buffering problem?