Skip to main content

fast_trace_task

Executes a task trace by decoding the message body, updating the request state with task arguments and metadata, and invoking the task's internal tracing mechanism.

def fast_trace_task(
task: str,
uuid: str,
request: dict,
body: bytes|tuple,
content_type: str,
content_encoding: str,
loads: callable = loads_message,
_loc: tuple = None,
hostname: str = None
) - > tuple

Executes a task trace by deserializing the message body and invoking the task's internal tracing mechanism. Use this function to efficiently process and track task execution state within a distributed worker environment.

Parameters

NameTypeDescription
taskstrThe name of the task to be traced, used as a key to look up the task instance.
uuidstrThe unique identifier for the specific task execution instance.
requestdictThe request context dictionary to be updated with task arguments and metadata.
body`bytestuple`
content_typestrThe MIME type of the message body used to determine the appropriate deserialization method.
content_encodingstrThe character encoding or compression format of the message body.
loadscallable = loads_messageThe deserialization function used to parse the message body into Python objects.
_loctuple = NoneA cached tuple containing the task registry, accepted content types, and hostname for performance optimization.
hostnamestr = NoneThe name of the node executing the task, used for logging and request metadata.

Returns

TypeDescription
tupleA tuple containing the execution status (1 for success, 0 for failure), the result or traceback string, and the execution time.