asynchronous python call

Tino Wildenhain tino at wildenhain.de
Wed Apr 8 14:08:16 EDT 2009


Hi,

joeygartin wrote:
> Complete newbie, so forgive my improper use of Python terminology.
> 
> I am working with Django and I have to send off a number of emails
> after a person has filled out a form.  What I want is to make a call
> that goes off to form and send the emails and redirect the user to
> another view.  I have this working now, but I noticed it is a bit
> slow.  So I was hoping there was a way to spin off the process and
> redirect the user to the page while the emails are being formed and
> sent vs. making the page hang while it is done.

You best bet would be something like Zope's asynchronous mail handler
which is simply a queue Folder where you write the mail to be send
and having an outside process completely independend to scan for new
mail to be send out from time to time. If you want to speed up the
pickup time you could have the mail sender process open a socket (UDP
for example) where you can ping once you wrote out the mails to be send.

Regards
Tino



More information about the Python-list mailing list