Skip to main content

collect_ids

Used as a callback in a chain or group where the previous tasks are :task:ids: returns a tuple of::

    (previous_result, (root_id, parent_id, i))
def collect_ids(
self: celery.app.task.Task,
res: Any,
i: int
) - > tuple

Used as a callback in a chain or group where the previous tasks are :task:ids: returns a tuple of:: (previous_result, (root_id, parent_id, i))

Parameters​

NameTypeDescription
selfcelery.app.task.TaskThe task instance automatically bound to the function by the @shared_task decorator.
resAnyThe result passed from the previous task in the Celery chain or group.
iintAn index or identifier used to track the specific task's position or sequence.

Returns​

TypeDescription
tupleA nested tuple containing the previous task's result and a sub-tuple of the current task's root ID, parent ID, and the provided index.