Browse Source

Adds Task.map + Task.starmap

Ask Solem 13 years ago
parent
commit
57eb25ccc1
1 changed files with 8 additions and 0 deletions
  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.