Skip to content
Myr

prefetch=False for async.map

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 27ee6e0 · Browse files · 1 file+5 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−2 removed

  • other:+5 added−2 removed

1 file+5 added−2 removed

modified:requests/async.py+5 added-2 removed
62 unmodified lines
63delete = _patched(api.delete)64request = _patched(api.request)656667def map(requests):67def map(requests, prefetch=True):68 """Concurrently converts a list of Requests to Responses.6970 :param requests: a collection of Request objects.71 :param keep_alive: If True, HTTP Keep-Alive will be used.71 :param prefetch: If False, the content will not be downloaded immediately.72 """7374 jobs = [gevent.spawn(_send, r) for r in requests]75 gevent.joinall(jobs)7677 if prefetch:78 [r.response.content for r in requests]7980 return [r.response for r in requests]818283
1 unmodified line