celery.worker.state
Internal worker state (global).
This includes the currently active and reserved tasks, statistics, and revoked tasks.
- classcelery.worker.state.Persistent(state, filename, clock=None)
-
Stores worker state between restarts.
This is the persistent data stored by the worker when
celery worker --statedbis enabled.Currently only stores revoked task id’s.
- close()
- compress(level=-1)
-
Returns a bytes object containing compressed data.
- data
-
Binary data to be compressed.
- level
-
Compression level, in 0-9 or -1.
- propertydb
- decompress(wbits=15, bufsize=16384)
-
Returns a bytes object containing the uncompressed data.
- data
-
Compressed data.
- wbits
-
The window buffer size and container format.
- bufsize
-
The initial output buffer size.
- merge()
- open()
- protocol=4
- save()
- storage=<module 'shelve' from '/home/docs/.asdf/installs/python/3.9.22/lib/python3.9/shelve.py'>
- sync()
- celery.worker.state.SOFTWARE_INFO={'sw_ident': 'py-celery', 'sw_sys': 'Linux', 'sw_ver': '5.6.3'}
-
Worker software/platform information.
- celery.worker.state.active_requests=set()
-
set of currently active
Request’s.
- celery.worker.state.maybe_shutdown()
-
Shutdown if flags have been set.
- celery.worker.state.reserved_requests=set()
-
set of all reserved
Request’s.
- celery.worker.state.revoked=<LimitedSet(0): maxlen=50000, expires=10800.0, minlen=0>
-
the list of currently revoked tasks. Persistent if
statedbset.
- celery.worker.state.task_accepted(request, _all_total_count=None, add_request=<method-wrapper '__setitem__' of dict object>, add_active_request=<bound method WeakSet.add of set()>, add_to_total_count=<bound method Counter.update of Counter()>)
-
Update global state when a task has been accepted.
- celery.worker.state.task_ready(request, successful=False, remove_request=<built-in method pop of dict object>, discard_active_request=<bound method WeakSet.discard of set()>, discard_reserved_request=<bound method WeakSet.discard of set()>)
-
Update global state when a task is ready.
- celery.worker.state.task_reserved(request, add_request=<method-wrapper '__setitem__' of dict object>, add_reserved_request=<bound method WeakSet.add of set()>)
-
Update global state when a task has been reserved.
- celery.worker.state.total_count={}
-
count of tasks accepted by the worker, sorted by type.
Copyright © 2017-2026 Asif Saif Uddin, core team & contributors. All rights reserved.
Celery is licensed under The BSD License (3 Clause, also known as the new BSD license). The license is an OSI approved Open Source license and is GPL-compatible.
https://docs.celeryq.dev/en/stable/reference/celery.worker.state.html