Skip to content

Commit

Permalink
Merge pull request psf#287 from sharat87/patch-2
Browse files Browse the repository at this point in the history
Allow generators or any iterators for async.map
  • Loading branch information
Kenneth Reitz committed Nov 26, 2011
2 parents a77b916 + 99b6e35 commit 52ac241
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions requests/async.py
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 52ac241

Please sign in to comment.