Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix emoji chat to send messages to all clients #126

Closed
wants to merge 2 commits into from

Conversation

Joshix-1
Copy link
Member

@Joshix-1 Joshix-1 commented Oct 26, 2024

Modify the emoji chat to send new messages to all clients, regardless of the worker they are connected to.

  • an_website/emoji_chat/chat.py

    • Add REDIS_CHANNEL constant for the Redis channel name.
    • Modify save_new_message to publish messages to the Redis channel.
    • Add subscribe_to_redis_channel function to handle incoming messages.
    • Modify ChatWebSocketHandler to subscribe to the Redis channel on connection.
  • an_website/utils/background_tasks.py

    • Import subscribe_to_redis_channel from an_website/emoji_chat/chat.py.
    • Add subscribe_to_redis_channel to the list of background tasks.

For more details, open the Copilot Workspace session.

Joshix-1 and others added 2 commits October 26, 2024 22:35
Modify the emoji chat to send new messages to all clients, regardless of the worker they are connected to.

* **an_website/emoji_chat/chat.py**
  - Add `REDIS_CHANNEL` constant for the Redis channel name.
  - Modify `save_new_message` to publish messages to the Redis channel.
  - Add `subscribe_to_redis_channel` function to handle incoming messages.
  - Modify `ChatWebSocketHandler` to subscribe to the Redis channel on connection.

* **an_website/utils/background_tasks.py**
  - Import `subscribe_to_redis_channel` from `an_website/emoji_chat/chat.py`.
  - Add `subscribe_to_redis_channel` to the list of background tasks.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/asozialesnetzwerk/an-website?shareId=XXXX-XXXX-XXXX-XXXX).
@Joshix-1
Copy link
Member Author

llm bs

@Joshix-1 Joshix-1 closed this Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant