trace_task_ret
Traces the execution of a task by decoding the message body, updating the request context with metadata, and executing the task within the application's task registry.
def trace_task_ret(
name: string,
uuid: string,
request: dict,
body: any,
content_type: string,
content_encoding: string,
loads: callable = loads_message,
app: Celery = null,
extra_request: dict
) - > tuple
Traces the execution of a task by decoding the message body and executing the task within a trace context.
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | The registered name of the task to be executed. |
| uuid | string | The unique identifier for the specific task instance. |
| request | dict | The request context dictionary to be updated with task arguments and metadata. |
| body | any | The raw message body containing task arguments, which may be serialized or a pre-parsed tuple. |
| content_type | string | The MIME type of the message body used to determine the appropriate deserialization method. |
| content_encoding | string | The character encoding of the message body. |
| loads | callable = loads_message | The deserialization function used to decode the message body into Python objects. |
| app | Celery = null | The Celery application instance; defaults to the current application context if not provided. |
| extra_request | dict | Additional keyword arguments to be merged into the task request context. |
Returns
| Type | Description |
|---|---|
tuple | A tuple containing the execution status (1 for success, 0 for failure), the task result or traceback string, and the runtime duration. |