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
| Name | Type | Description |
|---|---|---|
| name | str | The name of the task to be executed. |
| id | str = None | The unique identifier for the task; if not provided, a new UUID is generated. |
| args | Sequence = () | Positional arguments to be passed to the task function. |
| kwargs | Mapping = None | Keyword arguments to be passed to the task function. |
| callbacks | Sequence[Signature] = None | A list of task signatures to be executed upon successful completion of the task. |
| errbacks | Sequence[Signature] = None | A list of task signatures to be executed if the task encounters an error. |
| chain | Sequence[Signature] = None | A list of task signatures representing the execution chain. |
| **options | Any | Additional execution options to be merged into the task payload. |
Returns
| Type | Description |
|---|---|
Mock | A mock message object containing the serialized task payload, headers, and content metadata. |