Skip to main content

replace_with_empty_chain

Replaces the current task with an empty Celery chain.

def replace_with_empty_chain(
self: celery.app.task.Task,
*_: any
) - > celery.canvas.chain

Replaces the current Celery task with an empty chain, effectively halting further execution in the current workflow.

Parameters

NameTypeDescription
selfcelery.app.task.TaskThe bound task instance used to access the replace method.
*_anyVariable positional arguments that are ignored by the function.

Returns

TypeDescription
celery.canvas.chainAn empty Celery chain object that replaces the existing task execution.