Selaa lähdekoodia

Documented celery.states

Ask Solem 15 vuotta sitten
vanhempi
commit
a5bb233e43
3 muutettua tiedostoa jossa 47 lisäystä ja 0 poistoa
  1. 38 0
      celery/states.py
  2. 8 0
      docs/reference/celery.states.rst
  3. 1 0
      docs/reference/index.rst

+ 38 - 0
celery/states.py

@@ -1,8 +1,46 @@
+""" Task States
+
+.. data:: PENDING
+
+    Task is waiting for execution or unknown.
+
+.. data:: SUCCESS
+
+    Task has been successfully executed.
+
+.. data:: FAILURE
+
+    Task execution resulted in failure.
+
+.. data:: RETRY
+
+    Task is being retried.
+
+"""
 PENDING = "PENDING"
 SUCCESS = "SUCCESS"
 FAILURE = "FAILURE"
 RETRY = "RETRY"
 
+
+"""
+.. data:: READY_STATES
+
+    Set of states meaning the task result is ready (has been executed).
+
+.. data:: UNREADY_STATES
+
+    Set of states meaning the task result is not ready (has not been executed).
+
+.. data:: EXCEPTION_STATES
+
+    Set of states meaning the task returned an exception.
+
+.. data:: ALL_STATES
+
+    Set of all possible states.
+
+"""
 READY_STATES = frozenset([SUCCESS, FAILURE])
 UNREADY_STATES = frozenset([PENDING, RETRY])
 EXCEPTION_STATES = frozenset([RETRY, FAILURE])

+ 8 - 0
docs/reference/celery.states.rst

@@ -0,0 +1,8 @@
+=============================
+ Task States - celery.states
+=============================
+
+.. currentmodule:: celery.states
+
+.. automodule:: celery.states
+    :members:

+ 1 - 0
docs/reference/index.rst

@@ -24,6 +24,7 @@
     celery.loaders.default
     celery.loaders.djangoapp
     celery.registry
+    celery.states
     celery.messaging
     celery.contrib.test_runner
     celery.views