Skip to main content

TaskTermination

Terminates a task in different ways.

Methods


apply_self_termination_task()

@classmethod
def apply_self_termination_task(
worker: CeleryTestWorker,
method: TaskTermination.Method
) - > [AsyncResult](../../../../../celery/result/asyncresult.md?sid=celery_result_asyncresult)

Apply a task that will terminate itself.

Parameters

NameTypeDescription
workerCeleryTestWorkerThe worker instance whose queue will be used to execute the self-terminating task
methodTaskTermination.MethodThe specific mechanism (e.g., SIGKILL, SYSTEM_EXIT) used to trigger the task's termination

Returns

TypeDescription
[AsyncResult](../../../../../celery/result/asyncresult.md?sid=celery_result_asyncresult)The result of applying the task.