Elektrine lite

← Feed

@mattiem@mastodon.social

Post #2625596

2026-04-30 17:49 UTC

@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?

Replies (1)

  • @patters@mastodon.social 2026-04-30 18:55

    @mattiem@mastodon.social ah, I misspoke. The ordering issue comes from merging: when you have multiple AsyncStreams to merge into a single stream on the other end, e.g. use a task group to enumerate each and re-yield into a separate continuation/stream. (That final stream is what is enumerated by the concurrent task.) Certainly no implicit ordering guarantees here but even if the “final yield” is done on main, ordering is not kept. It’s a solvable problem and somewhat analogous to actor reentrancy issues.

    Open ##2625597