Files
meeting-room/.tasks/v2-p2-async-bridge.md
vitya 1dffaae822 feat: Phase 2 — web server, REST API, WebSocket/SSE, UI [v0.2.0]
AsyncEventBridge bridges sync EventEmitter to asyncio consumers.
FastAPI app with session management, discussion control, roles/providers.
WebSocket for real-time events + inject, SSE for read-only streaming.
Minimal dark-theme HTML/JS UI. `meeting-room serve` CLI subcommand.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 08:50:04 +03:00

26 lines
959 B
Markdown

# v2-p2-async-bridge
## Goal
Bridge synchronous EventEmitter to asyncio so DiscussionEngine can run in a thread while WebSocket/SSE consumers receive events asynchronously.
## Key files
- `meeting_room/events.py` — add AsyncEventBridge class
- `meeting_room/engine.py` — no changes (runs in thread as-is)
## Decisions log
- 2026-05-04: AsyncEventBridge + asyncio.to_thread() chosen over async engine rewrite. Minimizes changes, engine stays sync.
## Open questions
- [ ] None
## Completed steps
- [x] AsyncEventBridge class in events.py
- [x] Thread-safe bridge with call_soon_threadsafe
- [x] subscribe/unsubscribe consumer queues
- [x] Drop policy on full queues
- [x] Tests (10/10 passing)
## Notes
- events.py already has comment: "In Phase 2, an AsyncEventBridge will forward events to WebSocket clients"
- Bridge subscribes to sync EventEmitter, puts events into asyncio.Queue
- Consumers (WebSocket handlers, SSE handlers) read from the queue