-
Notifications
You must be signed in to change notification settings - Fork 1
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
Coollaborative edition of schedules #165
Comments
https://pypi.org/project/python-socketio/ for server |
Maybe this is better for the server |
About the debate of Socket.IO vs Django Channels for the backend, I feel that Socket.IO is the better alternative. Django Channels is only useful if you are developing a pure Django (no Node.js) solution that should support multiple protocols. Since we are using Node.js and only care about WebSocket for the communication, this isn't very relevant. Socket.IO is also much more focused for real-time communication, which is exactly what we are after. It has multiple features for this end, like the rooms feature that we discussed in our meetings. Also note that Django Channels is not compatible with Socket.IO, so the frontend would have to use the standard WebSocket API. Being the one that will work with the WebSocket communication (in issues #233 of the frontend and #89 of the backend), I will proceed with the Socket.IO API, but tell me your thoughts if you think Django Channels is better. |
I agree with it, specially if by using django channels we would need to use raw websockets on the frontend, which would make the development experiente degraded. |
Apparently I discovered that the backend used Node.js, apparently not, my bad, but I still think it is best to setup Node.js to use Socket.IO. And about the use of Socket.IO vs WebSocket on the frontend, I don't think that using WebSocket is worse for the programmer experience (I even think that the Socket.IO API is a little crappier xD), but it does not provide many of the features that makes Socket.IO so useful. |
Are you suggesting having a separate nodejs server for socketio apart from the django that we already have? |
Forget what I just said, the Node.js thing is related to the frontend, we just need to include Socket.IO from pip, again my bad. |
Socket.io requires running a second instance among the already django server. For what it has to offer, I don't consider it worth. On the frontend part, we can easily create our own wrapper to attempt our needs. If the backend was in node.js, I would immediately recommend socket.io, but since it's Django, we should follow its philosophy and resources. |
When you say that it requires running a second instance are you talking about this part? If so, this is also the standard way to do it in a nodejs server (to instantiate a socketio server instance) |
Yes. The question is: Are we able to get authed user information from this approach? Also, are we able to get it by using Django channels? |
After digging more on this issue, I have to agree that creating a second instance for Socket.IO would probably be necessary, which isn't worth it. Ironically, the solution to that problem seems to be to also use Django Channels, in conjuction with Socket.IO, since it allows the Django HTTP methods to coexist with Socket.IO for WebSocket communication. This seems to be a popular approach and there are some guides explaining the setup (e.g. https://www.videosdk.live/developer-hub/socketio/django-socketio). I still need to test this further, but I will keep this thread updated. If this ends up being the best solution, then this debate will not need to be continued, as both libraries and their functionalities will be available to the backend 🙌 |
Does To be honest, I would prefer using raw django channels only. |
As stated here, using raw web sockets will require us to make a lot of functionality that is offered by socket.io, such as automatic reconnection, rooms and other features. @Process-ing Since if socket io can be used with django channels and you are on the issue of setting up the web sockets on the backend, can you explore if we can use |
Why
It is very common for students to want to choose the same schedule as their friends. Therefore, there should be a way for users to edit their schedule options in a collaborative session with their friends.
References
The text was updated successfully, but these errors were encountered: