Skip to main content

task_message_from_sig

Create task message from :class:celery.Signature.

def task_message_from_sig(
app: Celery,
sig: Signature,
utc: bool = True,
TaskMessage: Any = TaskMessage
) - > TaskMessage

Create task message from :class:celery.Signature.

Parameters

NameTypeDescription
appCeleryThe Celery application instance used to resolve current time and configuration.
sigSignatureThe task signature to be converted into a message; this signature will be frozen during the process.
utcbool = TrueFlag indicating whether the message timestamps should be treated as UTC.
TaskMessageAny = TaskMessageThe class or factory function used to instantiate the resulting task message object.

Returns

TypeDescription
TaskMessageA TaskMessage instance containing the frozen signature data, formatted ETA/expiry, and task metadata ready for publishing.