Should I Use Sockets or REST API for Class Joining in My Chat App?

0
0
Asked By CoolCat007 On

I'm working on a chat app where users can join different classes. I'm trying to decide whether to use sockets or a REST API for handling the class joining process. For context, the app uses Socket.IO for the actual chatting feature. What would be the best approach? Should I emit an event when a user wants to join, or would it make more sense to use a REST API for that part?

5 Answers

Answered By TechieTina89 On

I would recommend going with a REST API to handle the class joining. You can use sockets to notify the class when someone joins, making the process cleaner and more organized.

Answered By CodeWiz123 On

If your users can join classes on their own, a REST API works great. But if you need approval for joining a class, consider using sockets to notify the owner immediately. It really depends on how interactive you want the process to be.

Answered By QuestionMaster99 On

What do you mean by "classes" in this context? Are you talking about chat rooms that are currently active?

Answered By DataDynamo42 On

You might want to consider using CQRS. Have a command to join and a query for the student list or whatever needs to be displayed.

Answered By PixelPanda88 On

Using a REST API for joining a class is definitely the way to go. Save sockets for the chat functionality to keep it efficient.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.