This document describes an older version of Celery (2.1). For the latest stable version please go here.

Loader Base Classes - celery.loaders.base

class celery.loaders.base.BaseLoader

The base class for loaders.

Loaders handles to following things:

  • Reading celery client/worker configurations.

  • What happens when a task starts?

    See on_task_init().

  • What happens when the worker starts?

    See on_worker_init().

  • What modules are imported to find tasks?

conf

Loader configuration.

configured = False
import_default_modules()
import_from_cwd(module, imp=None)

Import module, but make sure it finds modules located in the current directory.

Modules located in the current directory has precedence over modules located in sys.path.

import_module(module)
import_task_module(module)
init_worker()
mail_admins(subject, body, fail_silently=False)
on_process_cleanup()

This method is called after a task is executed.

on_task_init(task_id, task)

This method is called before a task is executed.

on_worker_init()

This method is called when the worker (celeryd) starts.

override_backends = {}
worker_initialized = False

Previous topic

Loaders - celery.loaders

Next topic

Default Loader - celery.loaders.default

This Page