Browse Source

Document missing context fields

Ask Solem 12 years ago
parent
commit
23ce2cd58b
2 changed files with 24 additions and 0 deletions
  1. 4 0
      celery/app/task.py
  2. 20 0
      docs/userguide/tasks.rst

+ 4 - 0
celery/app/task.py

@@ -43,14 +43,18 @@ class Context(object):
     args = None
     kwargs = None
     retries = 0
+    eta = None
+    expires = None
     is_eager = False
     delivery_info = None
     taskset = None   # compat alias to group
     group = None
     chord = None
+    utc = None
     called_directly = True
     callbacks = None
     errbacks = None
+    timeouts = None
     _children = None   # see property
 
     def __init__(self, *args, **kwargs):

+ 20 - 0
docs/userguide/tasks.rst

@@ -199,6 +199,9 @@ The request defines the following attributes:
 
 :taskset: The unique id of the taskset this task is a member of (if any).
 
+:chord: The unique id of the chord this task belongs to (if the task
+        is part of the header).
+
 :args: Positional arguments.
 
 :kwargs: Keyword arguments.
@@ -209,6 +212,14 @@ The request defines the following attributes:
 :is_eager: Set to :const:`True` if the task is executed locally in
            the client, and not by a worker.
 
+:eta: The original ETA of the task (if any).
+      This is in UTC time (depending on the :setting:`CELERY_ENABLE_UTC`
+      setting).
+
+:expires: The original expiry time of the task (if any).
+          This is in UTC time (depending on the :setting:`CELERY_ENABLE_UTC`
+          setting).
+
 :logfile: The file the worker logs to.  See `Logging`_.
 
 :loglevel: The current log level used.
@@ -222,6 +233,15 @@ The request defines the following attributes:
                 Availability of keys in this dict depends on the
                 message broker used.
 
+:called_directly: This flag is set to true if the task was not
+                  executed by the worker.
+
+:callbacks: A list of subtasks to be called if this task returns successfully.
+
+:errback: A list of subtasks to be called if this task fails.
+
+:utc: Set to true the caller has utc enabled (:setting:`CELERY_ENABLE_UTC`).
+
 
 An example task accessing information in the context is: