Explorar o código

Document Celery.close and with statement usage

Ask Solem %!s(int64=12) %!d(string=hai) anos
pai
achega
d76bb1dc39
Modificáronse 1 ficheiros con 10 adicións e 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