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

celery.loaders.base

celery.loaders.base

Loader base class.

copyright:
  1. 2009 - 2011 by Ask Solem.
license:

BSD, see LICENSE for more details.

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?

cmdline_config_parser(args, namespace='celery', re_type=<_sre.SRE_Pattern object at 0x866fb60>, extra_types={'json': <function <lambda> at 0x870856c>}, override_types={'dict': 'json', 'list': 'json', 'tuple': 'json'})
conf

Loader configuration.

config_from_envvar(variable_name, silent=False)
config_from_object(obj, silent=False)
import_default_modules()
import_from_cwd(module, imp=None, package=None)
import_module(module, package=None)
import_task_module(module)
init_worker()
init_worker_process()
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, use_tls=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.

on_worker_process_init()

This method is called when a child process starts.

Previous topic

celery.loaders.default

Next topic

celery.registry

This Page