python - Async Tasks for Django and Gunicorn -
i have use case have send_email user in views. user submitted form not receive http response until email has been sent . not want make user wait on send_mail. want send mail asynchronously without caring of email error. using using celery sending mail async have read may overkill simpler tasks this. how can achieve above task without using celery
i'm assuming don't want wait because using external service (outside of control) sending email. if that's case setup local smtp server relay. many services such amazon ses, sendgrid, mandrill/mailchimp have directions on how it. application have wait on delivery localhost (which should fast , within control). final delivery forwarded on asynchronously request/response. stmp servers built handle delivery failures retries might gain moving celery.
Comments
Post a Comment