Skip to main content

TaskMessage1

Create task message in protocol 1 format.

def TaskMessage1(
name: str,
id: str = None,
args: Sequence = (),
kwargs: Mapping = None,
callbacks: Sequence[Signature] = None,
errbacks: Sequence[Signature] = None,
chain: Sequence[Signature] = None,
**options: Any
) - > Mock

Create task message in protocol 1 format.

Parameters

NameTypeDescription
namestrThe name of the task to be executed.
idstr = NoneThe unique identifier for the task; if not provided, a new UUID is generated.
argsSequence = ()Positional arguments to be passed to the task function.
kwargsMapping = NoneKeyword arguments to be passed to the task function.
callbacksSequence[Signature] = NoneA list of task signatures to be executed upon successful completion of the task.
errbacksSequence[Signature] = NoneA list of task signatures to be executed if the task encounters an error.
chainSequence[Signature] = NoneA list of task signatures representing the execution chain.
**optionsAnyAdditional execution options to be merged into the task payload.

Returns

TypeDescription
MockA mock message object containing the serialized task payload, headers, and content metadata.