Re: How does threading and processes work in Django

331 views
Skip to first unread message

Philip Mountifield

unread,
Oct 26, 2012, 4:11:04 AM10/26/12
to django...@googlegroups.com
I think what you are looking for is Celery (http://celeryproject.org/).
This handles asynchronous tasks in a clean and tidy manor meaning your
normal requests are free to return their responses while processing
continues. You can check the results of tasks later on in another request.

Regards
Philip

On 26/10/2012 03:56, dwang wrote:
> Hi,
>
> I'm new to Django and need some help understanding how threading works
> in Django. I have some data that I'd like to recompute periodically in
> the background and have it shared between requests. If I start a
> thread in one of the view functions (e.g. my_thread.start()), would
> Django kill this thread at some point? What if I start the thread in
> the main function before entering the server loop?
> Does Django handle each request in a separate process with its own
> interpreter instance?
> Where can I find a good explanation of how thread management works in
> Django?
>
> Any pointers would be greatly appreciated!
> Danyao
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/UlalOvj7a9EJ.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.


--

Philip Mountifield
Formac Electronics Ltd
tel +44 (0) 1225 837333
fax +44 (0) 1225 430995

pmount...@formac.net
www.formac.net
www.telgas.net

dwang

unread,
Nov 6, 2012, 8:14:48 PM11/6/12
to django...@googlegroups.com
Cool. I didn't know about Celery. Thanks Phillip!
Reply all
Reply to author
Forward
0 new messages