Skip to main content

AbortableTask

Task that can be aborted.

Attributes

AttributeTypeDescription
abstractboolean = TrueBoolean 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

NameTypeDescription
task_idstringThe unique identifier of the task for which to retrieve the result object.

Returns

TypeDescription
[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

NameTypeDescription
**kwargsdictOptional keyword arguments, specifically 'task_id' to check a specific task; defaults to the current request ID.

Returns

TypeDescription
booleanTrue if the task has been marked as ABORTED in the backend; otherwise False.