This document describes Celery 2.3. For development docs, go here.

celery.loaders.base

class celery.loaders.base.BaseLoader(app=None, **kwargs)

The base class for loaders.

Loaders handles,

  • 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?

builtin_modules = frozenset(['celery.task'])
cmdline_config_parser(args, namespace='celery', re_type=<_sre.SRE_Pattern object at 0x1308be8>, extra_types={'json': <function loads at 0x139c938>}, override_types={'dict': 'json', 'list': 'json', 'tuple': 'json'})
conf

Loader configuration.

config_from_envvar(variable_name, silent=False)
config_from_object(obj, silent=False)
configured = False
error_envvar_not_set = 'The environment variable %r is not set,\nand as such the configuration could not be loaded.\nPlease set this variable and make it point to\na configuration module.'
import_default_modules()
import_from_cwd(module, imp=None)
import_module(module)
import_task_module(module)
init_worker()
mail
mail_admins(subject, body, fail_silently=False, sender=None, to=None, host=None, port=None, user=None, password=None, timeout=None, use_ssl=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

celery.loaders.default

Next topic

celery.registry

This Page