Worker Controller Threads - celery.worker.controllers

Worker Controller Threads

class celery.worker.controllers.BackgroundThread

Thread running an infinite loop which for every iteration calls its on_iteration() method.

This also implements graceful shutdown of the thread by providing the stop() method.

on_iteration()

This is the method called for every iteration and must be implemented by every subclass of BackgroundThread.

on_start()

This handler is run at thread start, just before the infinite loop.

on_stop()

This handler is run when the thread is shutdown.

run()

This is the body of the thread.

To start the thread use start() instead.

stop()

Gracefully shutdown the thread.

class celery.worker.controllers.Mediator(ready_queue, callback, logger=None)

Thread continuously sending tasks in the queue to the pool.

ready_queue

The task queue, a Queue.Queue instance.

callback

The callback used to process tasks retrieved from the ready_queue.

on_iteration()

Get tasks from bucket queue and apply the task callback.

class celery.worker.controllers.ScheduleController(eta_schedule, logger=None, precision=None)

Schedules tasks with an ETA by moving them to the bucket queue.

on_iteration()

Wake-up scheduler

Previous topic

Executable Jobs - celery.worker.job

Next topic

Token Bucket (rate limiting) - celery.worker.buckets

This Page