Celery v1.1.1 (unstable) documentation

This Page

Task Pool - celery.worker.pool

Process Pools.

class celery.worker.pool.TaskPool(limit, logger=None, initializer=None, maxtasksperchild=None, timeout=None, soft_timeout=None, putlocks=True)

Process Pool for processing tasks in parallel.

Parameters:
limit

The number of processes that can run simultaneously.

logger

The logger used for debugging.

apply_async(target, args=None, kwargs=None, callbacks=None, errbacks=None, accept_callback=None, timeout_callback=None, **compat)

Equivalent of the :func:apply built-in function.

All callbacks and errbacks should complete immediately since otherwise the thread which handles the result will get blocked.

on_ready(callbacks, errbacks, ret_value)

What to do when a worker task is ready and its return value has been collected.

start()

Run the task pool.

Will pre-fork all workers so they’re ready to accept tasks.

stop()

Terminate the pool.