Thursday, November 4, 2010

Forking a background process on request

Hi,

I am working on a web app that creates reports that may take up to a
minute to generate. (Or longer under heavy loads.) Ideally I would
like something like this to happen:

1. User presses a button on the website. Javascript sends a begin-
report-creation message to the server.
2. Report creation begins on the server in a separate process and the
called view function returns "ok".
3. A bit of Javascript checks every ten seconds if the report is done.
4. If the report is done, another bit of Javascript loads it into the
website for display.

My question is - what is the best way of forking a separate process in
step 2 to start the actual background report generation while also
returning an "ok" message to the calling Javascript? Or do I even need
a separate process? What sort of concurrency issues do I need to worry
about?

Reports are currently generated once every hour by a cron-launched
Python script. This is working splendidly.

Best,
Elver
P.S: Django is awesome! I've only been using it for a couple of days,
but I gotta say, I've never been so productive with any other
framework of any kind.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate