If the task is in a pending state or if it is currently running, you can see the arguments of the task. The easiest way is to use the celery screening method.
from celery.task.control import inspect
i = inspect()
active_tasks = i.active()
reserved_tasks = i.reserved()
scheduled_tasks = i.scheduled()
You can iterate over them and use the task identifier, you can get all the task details like this
{'acknowledged': True,
'args': '(1000,)',
'delivery_info': {'exchange': '',
'priority': 0,
'redelivered': None,
'routing_key': 'celery'},
'hostname': 'celery@pavilion',
'id': '30d41ba2-3e71-49ce-8e7d-830ba1152256',
'kwargs': '{}',
'name': 't.wait',
'time_start': 1007.945882783,
'type': 't.wait',
'worker_pid': 10560}
In addition, you can also read data from a broker, process it, and you can receive tasks.
source
share