atagen

macltok

public
Star0
Watch0

Commit b2b7e7479384

tarball

atagen <boss@atagen.co>2026-09-27 01:42 UTC

1 file changed+7-0
docs: warn about awaiting answers while draining events

Several commands emit before they answer, so the task draining the bounded event stream can't also await them without deadlocking once the stream fills.
Modified file: README.md+7 additions
@@ -29,6 +29,13 @@ drop. a sent message answers when the sdk send queue has it, delivery shows up
2929 as the timeline item's send state. reads like `rooms`, `members` and `media`
3030 go straight to the sdk. the stream only carries state
3131
32+some commands put an event on the stream before they answer. `Open`, `Close`,
33+`OpenThread`, `CloseThread`, `Resync`, `Paginate`, `Logout` and the
34+verification actions all do. the stream is bounded, so a task that drains it
35+and awaits one of those answers deadlocks once it fills. from the draining
36+task, `try_send` the command and drop the `Pending`, the events tell you how it
37+went
38+
3239 start a timeline from `TimelineReset`, then apply each `TimelineChanged` whole
3340 with `TimelineDiff::try_apply_all`. snapshots are `imbl::Vector`s, re-exported
3441 as `macltok::imbl`, so a copy costs nothing. when a batch doesn't fit none of it