This document describes an older version of Celery (2.1). For the latest stable version please go here.

Worker Control - celery.worker.control

class celery.worker.control.ControlDispatch(logger=None, hostname=None, listener=None)

Execute worker control panel commands.

class Panel(logger, listener, hostname=None)
data = {'stats': <function stats at 0x6d7f410>, 'revoke': <function revoke at 0x67fe7d0>, 'enable_events': <function enable_events at 0x67fecf8>, 'set_loglevel': <function set_loglevel at 0x6d7f1b8>, 'dump_active': <function dump_active at 0x6d7f398>, 'dump_schedule': <function dump_schedule at 0x6d7f2a8>, 'rate_limit': <function rate_limit at 0x6d7f230>, 'disable_events': <function disable_events at 0x6d7f0c8>, 'cancel_consumer': <function cancel_consumer at 0x6d7f6e0>, 'dump_tasks': <function dump_tasks at 0x6d7f500>, 'dump_reserved': <function dump_reserved at 0x6d7f320>, 'add_consumer': <function add_consumer at 0x6d7f668>, 'shutdown': <function shutdown at 0x6d7f5f0>, 'dump_revoked': <function dump_revoked at 0x6d7f488>, 'heartbeat': <function heartbeat at 0x6d7f140>, 'ping': <function ping at 0x6d7f578>}
classmethod register(method, name=None)
ControlDispatch.ReplyPublisher

alias of ControlReplyPublisher

ControlDispatch.dispatch_from_message(message)

Dispatch by using message data received by the broker.

Example:

>>> def receive_message(message_data, message):
...     control = message_data.get("control")
...     if control:
...         ControlDispatch().dispatch_from_message(control)
ControlDispatch.execute(command, kwargs=None, reply_to=None)

Execute control command by name and keyword arguments.

Parameters:
  • command – Name of the command to execute.
  • kwargs – Keyword arguments.
ControlDispatch.reply(*args, **kwargs)

Previous topic

Worker Heartbeats - celery.worker.heartbeat

Next topic

Built-in Remote Control Commands - celery.worker.control.builtins

This Page