celery.loaders.base

Loader base class.

class celery.loaders.base.BaseLoader(app, **kwargs)[исходный код]

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='tasks')[исходный код]
builtin_modules = frozenset({})
cmdline_config_parser(args, namespace='celery', re_type=re.compile('\\((\\w+)\\)'), extra_types=None, override_types=None)[исходный код]
property conf

Loader configuration.

config_from_object(obj, silent=False)[исходный код]
configured = False
property default_modules
find_module(module)[исходный код]
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()[исходный код]
now(utc=True)[исходный код]
on_process_cleanup()[исходный код]

Called after a task is executed.

on_task_init(task_id, task)[исходный код]

Called before a task is executed.

on_worker_init()[исходный код]

Called when the worker (celery worker) starts.

on_worker_process_init()[исходный код]

Called when a child process starts.

on_worker_shutdown()[исходный код]

Called when the worker (celery worker) shuts down.

override_backends = {}
read_configuration(env='CELERY_CONFIG_MODULE')[исходный код]
shutdown_worker()[исходный код]
worker_initialized = False
Back to Top