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

celery.loaders.base

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

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?

cmdline_config_parser(args, namespace='celery', re_type=<_sre.SRE_Pattern object at 0x2ae94e0>, extra_types={'json': <function loads at 0x2b191b8>}, 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
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)
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