Friday 15 July 2011

django - Multi-threading a process within a view function -



django - Multi-threading a process within a view function -

in views, have process takes few seconds compute. stands, process comes before view function returns next webpage. however, not crucial process runs before, , in fact can run anytime. therefore, wondering if possible run process, , homecoming next webpage before process has finished. suppose considered multi-threading.

for example:

def myviewfunction(request): myprocess() # takes while finish homecoming render(request, 'myapp/mywebpage.html')

can run myprocess() in background, , homecoming render() myprocess() has been called, rather wait until has returned?

what looking celery. see this answer illustration of using celery within django.

django multithreading

No comments:

Post a Comment