Skip to main content

second_order_replace2

Executes a two-stage task sequence that pushes state messages to a Redis list and uses Celery's task replacement to chain a sub-task with a recursive call.

def second_order_replace2(
state: boolean = False
) - > null

Executes a multi-stage task sequence that logs execution state to Redis and dynamically replaces itself with a chained task workflow.

Parameters

NameTypeDescription
stateboolean = FalseA toggle used to determine the execution phase; when False, it triggers task replacement, and when True, it logs the completion phase.

Returns

TypeDescription
nullThis function does not return a value; it raises a TaskReplacement exception to alter the Celery task graph.