mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #287 from sharat87/patch-2
Allow generators or any iterators for async.map
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user