-
Notifications
You must be signed in to change notification settings - Fork 38
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
Should we add websockets for the poll to be live? #15
Labels
enhancement
New feature or request
Comments
I think this is a good idea, as wobsockets events are faster then HTTP requests, end this is the perfect usecase for them |
I think the best way to do it would be to use Socket.IO Rooms (One room per poll) |
@all-contributors add @Samuel-Martineau and @Dario-0 for ideas |
I've put up a pull request to add @Samuel-Martineau! 🎉 |
I'm open to this idea! |
I've added socket.io integration in this pull request |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, to have live data, we make an HTTP request twice per second. I think Web Sockets would be an alternative to consider. We could use Express WS or Socket.IO to transmit the data.
Pros: Prevents from doing unnecessary HTTP requests and spamming the server
Cons: To receive each new vote could spam the clients
Fix: We could make the server only send events each X seconds
Let me know what you think and, if you like the idea, I'll try to write a PR.
The text was updated successfully, but these errors were encountered: