BotNetwork

Actor-ish per-chat concurrency

serialize work per chat id to avoid races

Guide1 min readUpdated

Why it matters

Serialize work per chat id to avoid races.

Practical steps

  1. Draw the boundary for arch actor model: what belongs in the bot process vs a worker.
  2. Implement serialize work per chat id to avoid races behind a narrow interface so platforms can share it.
  3. Make arch actor model idempotent at the message/update id layer.
  4. Add contract tests between the adapter and the core for arch actor model.
  5. Document failure modes and ownership of arch actor model for on-call.

Watch out for

  • Copy-pasting outdated snippets for arch actor model without re-reading current official docs.
  • Shipping arch actor model to production without a staging rehearsal and a documented rollback.

Related comparisons and tools