asynchronous python call

Aahz aahz at pythoncraft.com
Wed Apr 8 15:52:11 EDT 2009


In article <637028a0-58b9-4912-896d-2b17e13414fe at q16g2000yqg.googlegroups.com>,
joeygartin  <joeygartin at gmail.com> wrote:
>
>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.

The simplest solution is to create an external program and use the
subprocess module to call it.  You could also use fork() directly, but
that's more complicated.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"...string iteration isn't about treating strings as sequences of strings, 
it's about treating strings as sequences of characters.  The fact that
characters are also strings is the reason we have problems, but characters 
are strings for other good reasons."  --Aahz



More information about the Python-list mailing list