packages/
Redis
Redis live room state, pub/sub, rate limiting, and write-behind queue integration.
Redis is the live authority and Postgres the durable one. Snapshot writes are atomic with a Lua version check; when a write lands, the room joins the dirty set and a coalesced flush job is scheduled — debounced, with a maximum wait, and forced when the last participant leaves. Rate budgets are per connection for ephemeral frames and stricter for commits.
What it owns
- Live room snapshots with atomic revision-checked writes
- The dirty-room set and the debounced flush queue
- The room event bus for cross-server fan-out
- Participant lists with join, renew, and leave
- Per-bucket message rate limits
Files
File list and purposes from the folder README.
| File | Purpose |
|---|---|
src/index.ts | Room state, pub/sub, queue, and rate-limit operations. |
Dependencies
| Library | Version range | Why it is used here |
|---|---|---|
| BullMQ | 6.3.12 | Durable flush queue between Redis and the worker. |
| ioredis | 6.0.0 | Redis client behind live snapshots and pub/sub. |
Development and tooling (3)
| Library | Version range | Why it is used here |
|---|---|---|
| @types/node | 26.4.1 | Type declarations for Node.js built-ins. |
| tsx | ^4.23.13 | Runs and watches TypeScript sources for development and tests. |
| TypeScript | 7.0.2 | Compiles the workspace and type-checks every package. |
Dependencies as of commit b0026d9.
Internal packages used
Laying out redis package…
BrowserAPIRealtimeCacheDatabaseShareddurableephemeral
Talks to
Sources: packages/redis/README.md, packages/redis/src/README.md, packages/redis/src/index.ts (documented at commit b0026d9)