Przeglądaj źródła

Document Celery.close and with statement usage

Ask Solem 12 lat temu
rodzic
commit
d76bb1dc39
1 zmienionych plików z 10 dodań i 0 usunięć
  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