Skip to main content

replace_with_chain_which_raises

Replaces the current task with a chain that executes an identity task followed by an error-raising task, optionally linking an error callback to a Redis echo signature.

def replace_with_chain_which_raises(
self: celery.app.task.Task,
*args: Any,
link_msg: Any = null
) - > celery.result.AsyncResult

Replaces the current task with a chain that executes an identity function followed by a task that raises an error, while optionally attaching an error callback.

Parameters

NameTypeDescription
selfcelery.app.task.TaskThe task instance being replaced, provided by the @shared_task(bind=True) decorator.
*argsAnyPositional arguments passed to the initial identity task in the chain.
link_msgAny = nullAn optional message to be passed to the redis_echo error callback task if the chain fails.

Returns

TypeDescription
celery.result.AsyncResultThe result of the task replacement, representing the newly created chain execution.