Implement real-time WebSocket gateway for presence, DM, and world chat (US-4, US-2)

This commit is contained in:
2026-09-15 18:58:19 +00:00
parent 4fc297be43
commit e5bcd61ee4
6 changed files with 773 additions and 1 deletions
+5
View File
@@ -109,6 +109,11 @@ class PresenceStore:
client = await self._ensure_client()
await client.set(self._heartbeat_key(user_id), "1", ex=self._heartbeat_ttl)
async def clear_heartbeat(self, user_id: int) -> None:
"""Clear heartbeat for *user_id* to mark them offline immediately."""
client = await self._ensure_client()
await client.delete(self._heartbeat_key(user_id))
# ------------------------------------------------------------------
# Online checks
# ------------------------------------------------------------------