AbortableTask
Task that can be aborted.
Attributes
| Attribute | Type | Description |
|---|---|---|
| abstract | boolean = True | Boolean flag indicating that this is an abstract base class and should not be registered as a concrete task. |
Methods
AsyncResult()
@classmethod
def AsyncResult(
task_id: string
) - > [AbortableAsyncResult](abortableasyncresult.md?sid=celery_contrib_abortable_abortableasyncresult)
Return the accompanying AbortableAsyncResult instance.
Parameters
| Name | Type | Description |
|---|---|---|
| task_id | string | The unique identifier of the task for which to retrieve the result object. |
Returns
| Type | Description |
|---|---|
[AbortableAsyncResult](abortableasyncresult.md?sid=celery_contrib_abortable_abortableasyncresult) | An instance of AbortableAsyncResult linked to the specified task ID and the current task's backend. |
is_aborted()
@classmethod
def is_aborted(
**kwargs: dict
) - > boolean
Return true if task is aborted.
Parameters
| Name | Type | Description |
|---|---|---|
| **kwargs | dict | Optional keyword arguments, specifically 'task_id' to check a specific task; defaults to the current request ID. |
Returns
| Type | Description |
|---|---|
boolean | True if the task has been marked as ABORTED in the backend; otherwise False. |