MCPcopy
hub / github.com/celery/celery / query_task

Method query_task

celery/app/control.py:340–370  ·  view source on GitHub ↗

Return detail of tasks currently executed by workers. Arguments: *ids (str): IDs of tasks to be queried. Returns: Dict: Dictionary ``{HOSTNAME: {TASK_ID: [STATE, TASK_INFO]}}``. Here is the list of ``TASK_INFO`` fields: * ``id`` - ID of

(self, *ids)

Source from the content-addressed store, hash-verified

338 return self._request('active_queues')
339
340 def query_task(self, *ids):
341 """Return detail of tasks currently executed by workers.
342
343 Arguments:
344 *ids (str): IDs of tasks to be queried.
345
346 Returns:
347 Dict: Dictionary ``{HOSTNAME: {TASK_ID: [STATE, TASK_INFO]}}``.
348
349 Here is the list of ``TASK_INFO`` fields:
350 * ``id`` - ID of the task
351 * ``name`` - Name of the task
352 * ``args`` - Positinal arguments passed to the task
353 * ``kwargs`` - Keyword arguments passed to the task
354 * ``type`` - Type of the task
355 * ``hostname`` - Hostname of the worker processing the task
356 * ``time_start`` - Time of processing start
357 * ``acknowledged`` - True when task was acknowledged to broker
358 * ``delivery_info`` - Dictionary containing delivery information
359 * ``exchange`` - Name of exchange where task was published
360 * ``routing_key`` - Routing key used when task was published
361 * ``priority`` - Priority used when task was published
362 * ``redelivered`` - True if the task was redelivered
363 * ``worker_pid`` - PID of worker processing the task
364
365 """
366 # signature used be unary: query_task(ids=[id1, id2])
367 # we need this to preserve backward compatibility.
368 if len(ids) == 1 and isinstance(ids[0], (list, tuple)):
369 ids = ids[0]
370 return self._request('query_task', ids=ids)
371
372 def conf(self, with_defaults=False):
373 """Return configuration of each worker.

Callers 5

test_query_taskMethod · 0.80
test_query_taskMethod · 0.80
query_tasksMethod · 0.80

Calls 1

_requestMethod · 0.95

Tested by 4

test_query_taskMethod · 0.64
test_query_taskMethod · 0.64