Explorar o código

Filled in the TODO gaps in the documentation for CancelableAsyncResult.

Vincent Driessen %!s(int64=15) %!d(string=hai) anos
pai
achega
b7fb99ed46
Modificáronse 1 ficheiros con 7 adicións e 3 borrados
  1. 7 3
      celery/contrib/cancelable.py

+ 7 - 3
celery/contrib/cancelable.py

@@ -95,10 +95,14 @@ class CancelableAsyncResult(AsyncResult):
         return self.backend.get_status(self.task_id) == CANCELLED
 
     def cancel(self):
-        """Set the state of the task to cancelled.
+        """Set the state of the task to :const:`CANCELLED`.
 
-        TODO: Be more descriptive. What does this mean for the worker?
-        TODO: What does the method return?
+        Cancelable tasks monitor their state at regular intervals and
+        terminate execution if so.
+
+        Be aware that invoking this method does not guarantee when the
+        task will be cancelled (or even if the task will be cancelled at
+        all).
 
         """
         # TODO: store_result requires all four arguments to be set, but only status should be updated here