second_order_replace1
Executes a Celery task that pushes a status message to Redis and conditionally replaces itself with a task chain consisting of second_order_replace2 and a recursive call to second_order_replace1 with an updated state.
def second_order_replace1(
self: celery.app.task.Task,
state: boolean = False
) - > null
Executes a two-phase task sequence that logs state transitions to Redis and recursively replaces itself with a chained execution of second_order_replace2.
Parameters
| Name | Type | Description |
|---|---|---|
| self | celery.app.task.Task | The Celery task instance, used to access the replace method for dynamic workflow modification. |
| state | boolean = False | A toggle determining the execution phase; False triggers the task chain replacement, while True logs the completion phase. |
Returns
| Type | Description |
|---|---|
null | This function raises a TaskReplacement exception to trigger Celery task replacement and does not return a value. |