Is celery's apply_async thread or process?

celery, python

Solution

Can someone tell me whether Celery executes a task in a thread or in a separate child process?

Neither, the task will be executed in a separate process possibly on a different machine. It is not a child process of the thread where you call 'delay'. The -C and -P options control how the worker process manages it's own threading. The worker processes get tasks through a message service which is also completely independent.

How would you compare celery's async with Twisted's reactor model? Is celery using reactor model after all?

Twisted is an event queue. It is asynchronous but it's not designed for parallel processing.

Problem

Can someone tell me whether Celery executes a task in a thread or in a separate child process? The documentation doesn't seem to explain it (read it like 3 times). If it is a thread, how does it get pass the GIL (particularly whom and how an event is notified)? How would you compare celery's async with Twisted's reactor model? Is celery using reactor model after all? Thanks,

Original source