Allow generators or any iterators for async.map

This commit is contained in:
Shrikant Sharat Kandula
2011-11-25 07:45:12 +05:30
parent 9d8d1d14f1
commit 99b6e35940
+2
View File
@@ -71,6 +71,8 @@ def map(requests, prefetch=True, size=None):
:param size: Specifies the number of requests to make at a time. If None, no throttling occurs.
"""
requests = list(requests)
if size:
pool = Pool(size)
pool.map(send, requests)