This document is for Celery's development version, which can be significantly different from previous releases. Get old docs here: 2.5.
Multiprocessing Pool implementation.
Class which supports an async version of applying functions to arguments.
Process objects represent activity that is run in a separate process
The class is analagous to threading.Thread
Return exit code of process or None if it has yet to stop
Return identifier (PID) of process or None if it has yet to start
Return whether process is alive
Wait until child process terminates
Return identifier (PID) of process or None if it has yet to start
Method to be run in sub-process; can be overridden in sub-class
Return a file descriptor (Unix) or handle (Windows) suitable for waiting for process termination.
Start child process
Terminate process; sends SIGTERM signal or uses TerminateProcess()
The soft time limit has been exceeded. This exception is raised to give the task a chance to clean up.
Equivalent of func(*args, **kwargs).
Asynchronous equivalent of apply() method.
Callback is called when the functions return value is ready. The accept callback is called when the job is accepted to be executed.
Simplified the flow is like this:
>>> if accept_callback:
... accept_callback()
>>> retval = func(*args, **kwds)
>>> if callback:
... callback(retval)
Equivalent of map() – can be MUCH slower than Pool.map().
Like imap() method but ordering of results is arbitrary.
Apply func to each element in iterable, collecting the results in a list that is returned.
Asynchronous equivalent of map() method.
Like map() method but the elements of the iterable are expected to be iterables as well and will be unpacked as arguments. Hence func and (a, b) becomes func(a, b).
Asynchronous version of starmap() method.
Run the task pool.
Will pre-fork all workers so they’re ready to accept tasks.
Gracefully stop the pool.
Force terminate the pool.
List of signals to ignore when a child process starts.
List of signals to reset when a child process starts.
Initializes the process so it can be used to process tasks.