Explorar el Código

Adds Task.map + Task.starmap

Ask Solem hace 13 años
padre
commit
57eb25ccc1
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  1. 8 0
      celery/app/task.py

+ 8 - 0
celery/app/task.py

@@ -715,6 +715,14 @@ class BaseTask(object):
         from celery import chunks
         from celery import chunks
         return chunks(self.s(), it, n)
         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):
     def update_state(self, task_id=None, state=None, meta=None):
         """Update task state.
         """Update task state.