django - Threading for sending Notifications and Emails -


i developing web application in django, on update call activity following things:

  1. call stored procedure update database.
  2. generating data notification.
  3. sending actual notification users.
  4. generating email data emails.
  5. sending actual emails users.

the users can more one, tested 50 users giving slow response there processing in call.

i planning implement thread run in background , steps 2,3,4 & 5 , call return response after step 1.

i confused whether doing right or wrong.

is there approach doing it?

i never have used threads kind of stuff ... , may problematic depending on server running. (are running multiple instances? every instance start thread? servers uwsgi disable threading default)

i use libraries django-q (http://django-q.readthedocs.io/en/latest/) or celery (http://www.celeryproject.org/) sending email , other stuff delay requests.

if using uwsgi serving app, has simple feature stuff that: http://uwsgi-docs.readthedocs.io/en/latest/mules.html


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -