This document describes the current stable version of Celery (4.0). For development docs, go here.

celery.loaders.base

Loader base class.

class celery.loaders.base.BaseLoader(app, **kwargs)[source]

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 happens when the worker shuts down?

    See on_worker_shutdown().

  • What modules are imported to find tasks?

autodiscover_tasks(packages, related_name=u'tasks')[source]
builtin_modules = frozenset([])
cmdline_config_parser(args, namespace=u'celery', re_type=<_sre.SRE_Pattern object>, extra_types={u'json': <function loads>}, override_types={u'dict': u'json', u'list': u'json', u'tuple': u'json'})[source]
conf

Loader configuration.

config_from_object(obj, silent=False)[source]
configured = False
default_modules[source]
find_module(module)[source]
import_default_modules()[source]
import_from_cwd(module, imp=None, package=None)[source]
import_module(module, package=None)[source]
import_task_module(module)[source]
init_worker()[source]
init_worker_process()[source]
now(utc=True)[source]
on_process_cleanup()[source]

Called after a task is executed.

on_task_init(task_id, task)[source]

Called before a task is executed.

on_worker_init()[source]

Called when the worker (celery worker) starts.

on_worker_process_init()[source]

Called when a child process starts.

on_worker_shutdown()[source]

Called when the worker (celery worker) shuts down.

override_backends = {}
read_configuration(env=u'CELERY_CONFIG_MODULE')[source]
shutdown_worker()[source]
worker_initialized = False