Friday, January 30, 2015

Re: Do Signals block Django process?


Thanks for always answering my questions :)

I did read the documentation on uWSGI and I think I have an understanding now of workers and threads (from Webserver or uWSGI) and how it handles multiple users.

For the signals and badge calculation, I did see celery pop up a couple of times and I did briefly look at their documentation. In theory I don't need this though because when the user submits a form, I want to check for achievements before showing him the results page. If I use celery then it might happen that the new view is rendered while the achievements are still being processed. Maybe I will have to go this route at some point but then I face two new problems (one of which I already have):
a) I need to figure out how to get the request that won a badge in order to send him a message (for this I opened an extra thread)
b) I would need to modify his current view, something like using Websocket. I did a quick google search in the past and apparently using websocket and django is not so easy. So if I can avoid it, I'm happy.

If I know that the signals are processed in sync, and before the new view is rendered, then I can just have the code after the signal check if a badge has been awarded and then render the view. Phew, still quite complicated.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a1f83580-11fc-414d-b806-9a0e5ed106ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment