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

Sending a message notification vs sending the message itself #36

Closed
realsuayip opened this issue Feb 7, 2022 · 2 comments
Closed

Sending a message notification vs sending the message itself #36

realsuayip opened this issue Feb 7, 2022 · 2 comments

Comments

@realsuayip
Copy link

Its indicated that:

When the frontend receives a new message notification (with the message ID),
it performs a GET query to the API to download the received message.

Could you explain the reasoning behind this? Why not just send the message
itself via websocket? İ'm also considering using this design but İ can't find a reasoning
not to do the other way.

@narrowfail
Copy link
Owner

Hello @realsuayip! Sure, by using a rest API you have more features to control the traffic. Throttling is just one example: https://www.django-rest-framework.org/api-guide/throttling/.

@realsuayip
Copy link
Author

realsuayip commented Feb 8, 2022

So, as I understand, you want to make use of HTTP stuff while transferring data to client. But in the context of "transferring data" only, do you know if there are other implications? For example, which way is more likely to ensure consistent flow of data, e.g., order of messages.

And how about security & server load? I'm trying to figure out the best practice on this. Thanks!

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

No branches or pull requests

2 participants