Browse Source

Documented celery.loaders.base

Ask Solem 15 years ago
parent
commit
9bb62dc1ae
1 changed files with 18 additions and 0 deletions
  1. 18 0
      celery/loaders/base.py

+ 18 - 0
celery/loaders/base.py

@@ -1,16 +1,34 @@
 
 
 class BaseLoader(object):
+    """The base class for loaders.
+
+    Loaders handles to following things:
+
+        * Reading celery client/worker configurations.
+
+        * What happens when a task starts?
+            See :meth:`on_task_init`.
+
+        * What happens when the worker starts?
+            See :meth:`on_worker_init`.
+
+        * What modules are imported to find tasks?
+
+    """
     _conf_cache = None
 
     def on_task_init(self, task_id, task):
+        """This method is called before a task is executed."""
         pass
 
     def on_worker_init(self):
+        """This method is called when the worker (``celeryd``) starts."""
         pass
 
     @property
     def conf(self):
+        """Loader configuration."""
         if not self._conf_cache:
             self._conf_cache = self.read_configuration()
         return self._conf_cache