瀏覽代碼

Added FAQ: Can I execute a task by name?

Ask Solem 15 年之前
父節點
當前提交
c3ff2cac97
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      FAQ

+ 11 - 0
FAQ

@@ -282,6 +282,17 @@ How can I reuse the same connection when applying tasks?
 
 **Answer**: See :doc:`userguide/executing`.
 
+Can I execute a task by name?
+-----------------------------
+
+**Answer**: Yes. Use :func:`celery.execute.send_task`.
+You can also execute a task by name from any language
+that has an AMQP client.
+
+    >>> from celery.execute import send_task
+    >>> send_task("tasks.add", args=[2, 2], kwargs={})
+    <AsyncResult: 373550e8-b9a0-4666-bc61-ace01fa4f91d>
+
 Results
 =======