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

Should we add websockets for the poll to be live? #15

Closed
Samuel-Martineau opened this issue Oct 10, 2020 · 6 comments
Closed

Should we add websockets for the poll to be live? #15

Samuel-Martineau opened this issue Oct 10, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@Samuel-Martineau
Copy link
Contributor

Samuel-Martineau commented Oct 10, 2020

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.

@D-B-0
Copy link

D-B-0 commented Oct 12, 2020

I think this is a good idea, as wobsockets events are faster then HTTP requests, end this is the perfect usecase for them

@Samuel-Martineau
Copy link
Contributor Author

I think the best way to do it would be to use Socket.IO Rooms (One room per poll)

@shiffman
Copy link
Member

@all-contributors add @Samuel-Martineau and @Dario-0 for ideas

@allcontributors
Copy link
Contributor

@shiffman

I've put up a pull request to add @Samuel-Martineau! 🎉

@shiffman
Copy link
Member

I'm open to this idea!

@shiffman shiffman added the enhancement New feature or request label Nov 23, 2020
@pieterdeschepper
Copy link
Contributor

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
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants