Skip to main content

replace_with_chain

Replaces the current task with a Celery chain that executes identity tasks and links a redis_echo signature, optionally passing a custom message to the linked task.

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

Replaces the current task with a chain of identity tasks and attaches an optional linked callback.

Parameters

NameTypeDescription
selfcelery.app.task.TaskThe current task instance being replaced.
*argsAnyPositional arguments passed to the initial identity task in the chain.
link_msgstring = nullAn optional message to be passed to the redis_echo callback; if provided, the callback becomes immutable.

Returns

TypeDescription
celery.result.AsyncResultThe result of the replacement chain execution.