Jay Parlar wrote:

> The thing is, I'm not sure how to fit that into Django. Currently, my
> view function just blocks on the generation/compilation. To do this
> with AJAX, it feels like I'd have to spawn a thread from Django to do
> the processing, and let the view return immediately. But when the
> resulting page does the first XMLHTTPRequest, how can I guarantee that
> it'll hit the same mod_python interpreter that's running my thread?

 Howsabout having a database table that keeps the state of the current
generation/compilation things going on. Your spawned thread just
updates its entry as it progresses. This could even be a Django model
of course! Just make sure your database handles concurrency correctly.

 Then your main template could have a block that queries that table for
any activity related to the current user and lists it. You could use
some ajax/timeouts to update it, or give the user an 'Update' button.
You'd probably have to write a custom tag to do this.

Barry


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to