attempting proxying

This commit is contained in:
2025-12-09 16:04:52 -05:00
parent 18e8fdb0a3
commit 611913c0f6
2 changed files with 13 additions and 0 deletions

View File

@@ -8,6 +8,8 @@ from flask import Response
from events.types.event import Event
logger = logging.getLogger(__name__)
# Maps user_id → dict of {connection_id: queue}
user_queues: Dict[str, Dict[str, queue.Queue]] = {}
logging.basicConfig(level=logging.INFO)
@@ -33,6 +35,8 @@ def send_to_user(user_id: str, data: Dict[str, Any]):
# Send to all connections for this user
for connection_id, q in user_queues[user_id].items():
try:
logger.info(f"Sending message to {connection_id}")
q.put(message)
q.put(message, block=False)
except queue.Full:
# Skip if queue is full (connection might be dead)