瀏覽代碼

Document Celery.close and with statement usage

Ask Solem 12 年之前
父節點
當前提交
d76bb1dc39
共有 1 個文件被更改,包括 10 次插入0 次删除
  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