Skip to main content

replace_with_stamped_task

Replaces the current task with a new task signature, defaulting to a 'replaced_with_me' signature if no replacement is provided.

def replace_with_stamped_task(
self: StampedTaskOnReplace,
replace_with: signature | None = None
) - > null

Replaces the current task execution with a new task signature, effectively handing off the execution flow to the specified task.

Parameters

NameTypeDescription
selfStampedTaskOnReplaceThe instance of the task being executed, providing access to the replacement logic.
replace_with`signatureNone` = None

Returns

TypeDescription
nullThis method does not return a value as it triggers a task replacement within the Celery worker.