Explorar el Código

Document Celery.close and with statement usage

Ask Solem hace 12 años
padre
commit
d76bb1dc39
Se han modificado 1 ficheros con 10 adiciones y 0 borrados
  1. 10 0
      docs/reference/celery.rst

+ 10 - 0
docs/reference/celery.rst

@@ -83,6 +83,16 @@ Application
 
         Base task class for this app.
 
+    .. method:: Celery.close
+
+        Cleans-up after application, like closing any pool connections.
+        Only necessary for dynamically created apps for which you can
+        use the with statement::
+
+            with Celery(...) as app:
+                with app.connection() as conn:
+                    pass
+
     .. method:: Celery.bugreport
 
         Returns a string with information useful for the Celery core