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
| Name | Type | Description |
|---|---|---|
| worker | CeleryTestWorker | The worker instance whose queue will be used to execute the self-terminating task |
| method | TaskTermination.Method | The specific mechanism (e.g., SIGKILL, SYSTEM_EXIT) used to trigger the task's termination |
Returns
| Type | Description |
|---|---|
[AsyncResult](../../../../../celery/result/asyncresult.md?sid=celery_result_asyncresult) | The result of applying the task. |