This document describes an older version of Celery (2.2). For the latest stable version please go here.
Process Pools.
Process Pool for processing tasks in parallel.
Parameters: |
|
---|
The number of processes that can run simultaneously.
The logger used for debugging.
Class which supports an async version of the apply() builtin
Process objects represent activity that is run in a separate process
The class is analagous to threading.Thread
Return whether process is a daemon
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
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 apply() builtin
Asynchronous equivalent of apply() builtin.
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 itertools.imap() – can be MUCH slower than Pool.map()
Like imap() method but ordering of results is arbitrary
Equivalent of map() builtin
Asynchronous equivalent of map() builtin
Run the task pool.
Will pre-fork all workers so they’re ready to accept tasks.
Gracefully stop the pool.
Force terminate the pool.