Skip to main content

WorkerKill

Kills a worker in different ways.

Attributes

AttributeTypeDescription
MethodEnumEnumeration of supported strategies for terminating a Celery worker process, including container-level kills and application-level shutdowns.

Methods


kill_worker()

@classmethod
def kill_worker(
worker: CeleryTestWorker,
method: WorkerKill.Method
)

Kill a Celery worker.

Parameters

NameTypeDescription
workerCeleryTestWorkerThe specific Celery worker instance to be terminated.
methodWorkerKill.MethodThe termination strategy to use, such as sending signals (SIGTERM, SIGQUIT), using Docker kill, or issuing a Celery control shutdown command.

Returns

TypeDescription
Nothing is returned; the method performs an in-place termination of the worker process or container.