On Thu, Jul 9, 2009 at 3:19 PM, Fluoborate<motoy...@gmail.com> wrote:
>
> Hello All,
>
> I am afraid that I might have to write my own middleware to do this. I
> really want to do something like the following:
>
> #In views.py:
>
> def welcome( request ):
>    return HttpResponse( "Welcome to my website" )
>    #No code after the 'return' statement will ever be executed, but I
> wish it would:
>    time-consuming_function( request )


the generic answer is to use a queue service (like rabbitMQ, or lots
of others).  a simplistic implementation is just stashing some
parameters into a DB table and use a cron job to 'execute' them
(called Ghetto queue in the 'scaling django' presentation).

there are some 'same process' python queues out there, mostly just a
thin wrapper on a python Queue object (which has task_done() and
join() methods just for this).  but for multi-process Django i don't
think it would work.

maybe is it possible to use signals like this? i haven't checked the
source,  but it seems plausible to have them dispatched _after_ the
request is serviced.

-- 
Javier

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to