This document describes the current stable version of Celery (4.3). For development docs, go here.

celery.worker.control

Worker remote control command implementations.

class celery.worker.control.Panel(**kwargs)[source]

Global registry of remote control commands.

data = {'active': <function active>, 'active_queues': <function active_queues>, 'add_consumer': <function add_consumer>, 'autoscale': <function autoscale>, 'cancel_consumer': <function cancel_consumer>, 'clock': <function clock>, 'conf': <function conf>, 'disable_events': <function disable_events>, 'dump_active': <function active>, 'dump_conf': <function conf>, 'dump_reserved': <function reserved>, 'dump_revoked': <function revoked>, 'dump_schedule': <function scheduled>, 'dump_tasks': <function registered>, 'election': <function election>, 'enable_events': <function enable_events>, 'heartbeat': <function heartbeat>, 'hello': <function hello>, 'memdump': <function memdump>, 'memsample': <function memsample>, 'objgraph': <function objgraph>, 'ping': <function ping>, 'pool_grow': <function pool_grow>, 'pool_restart': <function pool_restart>, 'pool_shrink': <function pool_shrink>, 'query_task': <function query_task>, 'rate_limit': <function rate_limit>, 'registered': <function registered>, 'report': <function report>, 'reserved': <function reserved>, 'revoke': <function revoke>, 'revoked': <function revoked>, 'scheduled': <function scheduled>, 'shutdown': <function shutdown>, 'stats': <function stats>, 'terminate': <function terminate>, 'time_limit': <function time_limit>}
meta = {'active': controller_info_t(alias='dump_active', type='inspect', visible=True, default_timeout=1.0, help='List of tasks currently being executed.', signature=None, args=None, variadic=None), 'active_queues': controller_info_t(alias=None, type='inspect', visible=True, default_timeout=1.0, help='List the task queues a worker is currently consuming from.', signature=None, args=None, variadic=None), 'add_consumer': controller_info_t(alias=None, type='control', visible=True, default_timeout=1.0, help='Tell worker(s) to consume from task queue by name.', signature='<queue> [exchange [type [routing_key]]]', args=[('queue', <class 'str'>), ('exchange', <class 'str'>), ('exchange_type', <class 'str'>), ('routing_key', <class 'str'>)], variadic=None), 'autoscale': controller_info_t(alias=None, type='control', visible=True, default_timeout=1.0, help='Modify autoscale settings.', signature='[max [min]]', args=[('max', <class 'int'>), ('min', <class 'int'>)], variadic=None), 'cancel_consumer': controller_info_t(alias=None, type='control', visible=True, default_timeout=1.0, help='Tell worker(s) to stop consuming from task queue by name.', signature='<queue>', args=[('queue', <class 'str'>)], variadic=None), 'clock': controller_info_t(alias=None, type='inspect', visible=True, default_timeout=1.0, help='Get current logical clock value.', signature=None, args=None, variadic=None), 'conf': controller_info_t(alias='dump_conf', type='inspect', visible=True, default_timeout=1.0, help='List configuration.', signature='[include_defaults=False]', args=[('with_defaults', <function strtobool>)], variadic=None), 'disable_events': controller_info_t(alias=None, type='control', visible=True, default_timeout=1.0, help='Tell worker(s) to stop sending task-related events.', signature=None, args=None, variadic=None), 'election': controller_info_t(alias=None, type='control', visible=True, default_timeout=1.0, help='Hold election.', signature=None, args=None, variadic=None), 'enable_events': controller_info_t(alias=None, type='control', visible=True, default_timeout=1.0, help='Tell worker(s) to send task-related events.', signature=None, args=None, variadic=None), 'heartbeat': controller_info_t(alias=None, type='control', visible=True, default_timeout=1.0, help='Tell worker(s) to send event heartbeat immediately.', signature=None, args=None, variadic=None), 'hello': controller_info_t(alias=None, type='inspect', visible=False, default_timeout=1.0, help='Request mingle sync-data.', signature=None, args=None, variadic=None), 'memdump': controller_info_t(alias=None, type='inspect', visible=True, default_timeout=1.0, help='Dump statistics of previous memsample requests.', signature='[n_samples=10]', args=[('samples', <class 'int'>)], variadic=None), 'memsample': controller_info_t(alias=None, type='inspect', visible=True, default_timeout=1.0, help='Sample current RSS memory usage.', signature=None, args=None, variadic=None), 'objgraph': controller_info_t(alias=None, type='inspect', visible=True, default_timeout=60.0, help='Create graph of uncollected objects (memory-leak debugging).', signature='[object_type=Request] [num=200 [max_depth=10]]', args=[('type', <class 'str'>), ('num', <class 'int'>), ('max_depth', <class 'int'>)], variadic=None), 'ping': controller_info_t(alias=None, type='inspect', visible=True, default_timeout=0.2, help='Ping worker(s).', signature=None, args=None, variadic=None), 'pool_grow': controller_info_t(alias=None, type='control', visible=True, default_timeout=1.0, help='Grow pool by n processes/threads.', signature='[N=1]', args=[('n', <class 'int'>)], variadic=None), 'pool_restart': controller_info_t(alias=None, type='control', visible=True, default_timeout=1.0, help='Restart execution pool.', signature=None, args=None, variadic=None), 'pool_shrink': controller_info_t(alias=None, type='control', visible=True, default_timeout=1.0, help='Shrink pool by n processes/threads.', signature='[N=1]', args=[('n', <class 'int'>)], variadic=None), 'query_task': controller_info_t(alias=None, type='inspect', visible=True, default_timeout=1.0, help='Query for task information by id.', signature='[id1 [id2 [... [idN]]]]', args=None, variadic='ids'), 'rate_limit': controller_info_t(alias=None, type='control', visible=True, default_timeout=1.0, help='Tell worker(s) to modify the rate limit for a task by type.', signature='<task_name> <rate_limit (e.g., 5/s | 5/m | 5/h)>', args=[('task_name', <class 'str'>), ('rate_limit', <class 'str'>)], variadic=None), 'registered': controller_info_t(alias='dump_tasks', type='inspect', visible=True, default_timeout=1.0, help='List of registered tasks.', signature='[attr1 [attr2 [... [attrN]]]]', args=None, variadic='taskinfoitems'), 'report': controller_info_t(alias=None, type='inspect', visible=True, default_timeout=1.0, help='Information about Celery installation for bug reports.', signature=None, args=None, variadic=None), 'reserved': controller_info_t(alias='dump_reserved', type='inspect', visible=True, default_timeout=1.0, help='List of currently reserved tasks, not including scheduled/active.', signature=None, args=None, variadic=None), 'revoke': controller_info_t(alias=None, type='control', visible=True, default_timeout=1.0, help='Revoke task by task id (or list of ids).', signature='[id1 [id2 [... [idN]]]]', args=None, variadic='task_id'), 'revoked': controller_info_t(alias='dump_revoked', type='inspect', visible=True, default_timeout=1.0, help='List of revoked task-ids.', signature=None, args=None, variadic=None), 'scheduled': controller_info_t(alias='dump_schedule', type='inspect', visible=True, default_timeout=1.0, help='List of currently scheduled ETA/countdown tasks.', signature=None, args=None, variadic=None), 'shutdown': controller_info_t(alias=None, type='control', visible=True, default_timeout=1.0, help='Shutdown worker(s).', signature=None, args=None, variadic=None), 'stats': controller_info_t(alias=None, type='inspect', visible=True, default_timeout=1.0, help='Request worker statistics/information.', signature=None, args=None, variadic=None), 'terminate': controller_info_t(alias=None, type='control', visible=True, default_timeout=1.0, help='Terminate task by task id (or list of ids).', signature='<signal> [id1 [id2 [... [idN]]]]', args=[('signal', <class 'str'>)], variadic='task_id'), 'time_limit': controller_info_t(alias=None, type='control', visible=True, default_timeout=1.0, help='Tell worker(s) to modify the time limit for task by type.', signature='<task_name> <soft_secs> [hard_secs]', args=[('task_name', <class 'str'>), ('soft', <class 'float'>), ('hard', <class 'float'>)], variadic=None)}
classmethod register(*args, **kwargs)[source]

Register a virtual subclass of an ABC.

Returns the subclass, to allow usage as a class decorator.