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

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -