浏览代码

Adds Task.map + Task.starmap

Ask Solem 13 年之前
父节点
当前提交
57eb25ccc1
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      celery/app/task.py

+ 8 - 0
celery/app/task.py

@@ -715,6 +715,14 @@ class BaseTask(object):
         from celery import chunks
         return chunks(self.s(), it, n)
 
+    def map(self, it):
+        from celery import xmap
+        return xmap(self.s(), it)
+
+    def starmap(self, it):
+        from celery import xstarmap
+        return xstarmap(self.s(), it)
+
     def update_state(self, task_id=None, state=None, meta=None):
         """Update task state.