Celery v0.8.1 (stable) documentation

This Page

Process Supervisor - celery.supervisor

exception celery.supervisor.MaxRestartsExceededError
Restarts exceeded the maximum restart frequency.
class celery.supervisor.OFASupervisor(target, args=None, kwargs=None, max_restart_freq=3, join_timeout=2, max_restart_freq_time=10, check_interval=2)

Process supervisor using the one_for_all strategy.

However, instead of registering a list of processes, you have one process which runs a pool. Makes for an easy implementation.

Parameters:
target
The target callable to be launched in a new process.
args
The positional arguments to apply to target.
kwargs
The keyword arguments to apply to target.
max_restart_freq

Limit the number of restarts which can occur in a given time interval.

The max restart frequency is the number of restarts that can occur within the interval max_restart_freq_time.

The restart mechanism prevents situations where the process repeatedly dies for the same reason. If this happens both the process and the supervisor is terminated.

max_restart_freq_time
See max_restart_freq.
check_interval
The time in seconds, between process pings.
class Process(group=None, target=None, name=None, args=(), kwargs={})

Process objects represent activity that is run in a separate process

The class is analagous to threading.Thread

daemon
Return whether process is a daemon
exitcode
Return exit code of process or None if it has yet to stop
ident
Return indentifier (PID) of process or None if it has yet to start
is_alive()
Return whether process is alive
join(timeout=None)
Wait until child process terminates
pid
Return indentifier (PID) of process or None if it has yet to start
run()
Method to be run in sub-process; can be overridden in sub-class
start()
Start child process
terminate()
Terminate process; sends SIGTERM signal or uses TerminateProcess()
OFASupervisor.start()
Launches the target in a seperate process and starts supervising it.