Skip to content

Commit

Permalink
Allow generators or any iterators for async.map
Browse files Browse the repository at this point in the history
  • Loading branch information
sharat87 committed Nov 25, 2011
1 parent 9d8d1d1 commit 99b6e35
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions requests/async.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 99b6e35

Please sign in to comment.