Celery Signature interface.
Attributes
| Attribute | Type | Description |
|---|
| name | string | The string name of the task associated with this signature. |
| type | Any | The concrete task class or type instance this signature represents. |
| app | Celery.app | The Celery application instance bound to this signature. |
| id | string | The unique task identifier assigned to this signature. |
| task | Any | The actual task function or object that this signature wraps. |
| args | list | A list of positional arguments to be passed to the task during execution. |
| kwargs | dict | A dictionary of keyword arguments to be passed to the task during execution. |
| options | dict | A dictionary of execution options such as routing, countdowns, or expiration settings. |
| subtask_type | string | The specific type of subtask this signature represents, such as a group or chain. |
| chord_size | integer | The number of tasks in the chord if this signature is part of a chord header. |
| immutable | boolean | A boolean flag indicating whether the signature's arguments are protected from modification by callbacks. |
Methods
name()
@classmethod
def name() - > string
Retrieves the name of the task associated with this signature.
Returns
| Type | Description |
|---|
string | The registered name of the Celery task |
type()
@classmethod
def type() - > object
Retrieves the task type or class instance for this signature.
Returns
| Type | Description |
|---|
object | The task instance or type associated with the signature |
app()
@classmethod
def app() - > object
Retrieves the Celery application instance bound to this signature.
Returns
| Type | Description |
|---|
object | The Celery app instance used for task execution context |
id()
@classmethod
def id() - > string
Retrieves the unique identifier assigned to this task signature.
Returns
| Type | Description |
|---|
string | The UUID string representing the task identity |
task()
@classmethod
def task() - > object
Retrieves the actual task implementation linked to this signature.
Returns
| Type | Description |
|---|
object | The callable task object |
args()
@classmethod
def args() - > tuple
Retrieves the positional arguments defined for the task call.
Returns
| Type | Description |
|---|
tuple | A tuple of positional arguments to be passed to the task |
kwargs()
@classmethod
def kwargs() - > dict
Retrieves the keyword arguments defined for the task call.
Returns
| Type | Description |
|---|
dict | A dictionary of keyword arguments to be passed to the task |
options()
@classmethod
def options() - > dict
Retrieves the execution options such as countdown, eta, or queue settings.
Returns
| Type | Description |
|---|
dict | A dictionary containing task execution configuration |
subtask_type()
@classmethod
def subtask_type() - > string
Retrieves the specific type of subtask if this signature is part of a complex workflow.
Returns
| Type | Description |
|---|
string | The subtask type identifier, such as 'chain' or 'group' |
chord_size()
@classmethod
def chord_size() - > integer
Retrieves the number of tasks in the chord if this signature is a chord header.
Returns
| Type | Description |
|---|
integer | The count of tasks expected to complete before the callback |
immutable()
@classmethod
def immutable() - > boolean
Indicates whether the signature's arguments are protected from being modified by previous tasks in a chain.
Returns
| Type | Description |
|---|
boolean | True if the signature is immutable, False otherwise |
clone()
@classmethod
def clone(
args: tuple = None,
kwargs: dict = None
) - > object
Creates a copy of the signature with optional overrides for arguments.
Parameters
| Name | Type | Description |
|---|
| args | tuple = None | Positional arguments to prepend to the existing arguments |
| kwargs | dict = None | Keyword arguments to merge with existing ones |
Returns
| Type | Description |
|---|
object | A new signature instance with the merged arguments |
freeze()
@classmethod
def freeze(
id: string = None,
group_id: string = None,
chord: object = None,
root_id: string = None,
group_index: integer = None
) - > object
Finalizes the signature by assigning a concrete task ID and other workflow identifiers.
Parameters
| Name | Type | Description |
|---|
| id | string = None | The specific task UUID to assign |
| group_id | string = None | The ID of the group this task belongs to |
| chord | object = None | The chord callback signature if applicable |
| root_id | string = None | The ID of the root task in the workflow |
| group_index | integer = None | The position of the task within a group |
Returns
| Type | Description |
|---|
object | An AsyncResult instance representing the future result of the task |
set()
@classmethod
def set(
immutable: boolean = None,
**options: dict
) - > object
Updates the execution options or immutability status of the signature.
Parameters
| Name | Type | Description |
|---|
| immutable | boolean = None | Whether to prevent argument modification in chains |
| **options | dict | Arbitrary execution options like 'queue', 'countdown', or 'priority' |
Returns
| Type | Description |
|---|
object | The signature instance with updated options for chaining |
link()
@classmethod
def link(
callback: object
) - > object
Appends a callback task to be executed upon successful completion of this task.
Parameters
| Name | Type | Description |
|---|
| callback | object | The signature of the task to execute on success |
Returns
| Type | Description |
|---|
object | The signature instance for chaining |
link_error()
@classmethod
def link_error(
errback: object
) - > object
Appends an error handler task to be executed if this task fails.
Parameters
| Name | Type | Description |
|---|
| errback | object | The signature of the task to execute on failure |
Returns
| Type | Description |
|---|
object | The signature instance for chaining |