EVECelery.EVECeleryWorker#

Module Contents#

Classes#

EVECeleryWorker

Celery worker server wrapper.

class EVECelery.EVECeleryWorker.EVECeleryWorker(broker_user: str | None = None, broker_password: str | None = None, broker_host: str | None = None, broker_port: int | None = None, broker_vhost: str | None = None, result_user: str | None = None, result_password: str | None = None, result_host: str | None = None, result_port: int | None = None, result_db: int | None = None, queue_prefix: str = 'EVECelery.', worker_log_level: str | None = 'ERROR', connection_check: bool = False)#

Celery worker server wrapper. Creating an instance of this class creates a celery app and registers the default tasks.

Parameters:
  • broker_user (Optional[str]) – RabbitMQ user

  • broker_password (Optional[str]) – RabbitMQ password

  • broker_host (Optional[str]) – RabbitMQ hostname

  • broker_port (Optional[int]) – RabbitMQ port - normally 5672

  • broker_vhost (Optional[str]) – RabbitMQ vhost - namespace for all EVECelery queues

  • result_user (Optional[str]) – Redis user - normally “default” if not explicitly configured

  • result_password (Optional[str]) – Redis password

  • result_host (Optional[str]) – Redis hostname

  • result_port (Optional[int]) – Redis port - normally 6379

  • result_db (Optional[int]) – Redis db - normally 0 for the default db

  • queue_prefix (str) – Prefix to add to all generated ESI queue names

  • worker_log_level (Optional[str]) – The Celery worker log level for console output

  • connection_check (bool) –

property tasks: EVECelery.tasks.TaskDirectory#
Return type:

EVECelery.tasks.TaskDirectory

celery_config() dict#
Return type:

dict

_register_all_tasks()#

Register all subtasks that inherit from BaseTask

This method will register and initialize all subtasks that inherit from BaseTask.

register_additional_queue(queue: str)#

Register an additional queue that this Celery app should process.

Parameters:

queue (str) – Name of the queue

Returns:

None

register_task_route(task_name: str, queue_name: str)#

Register a task to a specific queue using a Celery task route.

Parameters:
  • task_name (str) – The name of the task

  • queue_name (str) – Name of the queue to route tasks to.

Returns:

None

register_task(task: celery.Task)#

Register a task instance with the Celery app. A task must inherit from the Celery Task base class.

Parameters:

task (celery.Task) – A task instance

Returns:

None

classmethod print_header()#
start()#

Starts the Celery app and beings processing messages in the queues.

Returns:

None