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: Ensure single Redis message listener #19

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

gabrielmatau79
Copy link
Contributor

Destructuring the 'message' listener outside of the addLiveSession method to be initialized in the constructor, the following changes are made:

  • The Redis 'message' listener is removed, and a method initializeRedisMessageListener() is defined, which will be instantiated in the constructor after the Redis connection.
  • In the addLiveSession method, the socket_id parameter is added to the session storage.
  • When the listener receives a new message, it will call the handleMessages function, which will be responsible for constructing the message to be sent to the corresponding socket_id.

@gabrielmatau79 gabrielmatau79 self-assigned this Oct 24, 2024
@genaris genaris merged commit 22848d7 into main Oct 24, 2024
4 checks passed
@genaris genaris deleted the refactor/redis-listener-sending-message branch October 24, 2024 18:46
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.

2 participants