django - Threading for sending Notifications and Emails -
i developing web application in django, on update call activity following things:
- call stored procedure update database.
- generating data notification.
- sending actual notification users.
- generating email data emails.
- 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
Post a Comment