Skip to content

Commit

Permalink
Remove keep_alive cruft from urllib3 (for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Reitz committed Oct 14, 2011
1 parent 9518d05 commit 5537902
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions requests/async.py
Expand Up @@ -20,7 +20,6 @@

from . import api
from .hooks import dispatch_hook
from .packages.urllib3.poolmanager import PoolManager


__all__ = (
Expand Down Expand Up @@ -65,19 +64,14 @@ def _send(r, pools=None):
request = _patched(api.request)


def map(requests, keep_alive=False):
def map(requests):
"""Concurrently converts a list of Requests to Responses.
:param requests: a collection of Request objects.
:param keep_alive: If True, HTTP Keep-Alive will be used.
"""

if keep_alive:
pools = PoolManager(num_pools=len(requests), maxsize=1)
else:
pools = None

jobs = [gevent.spawn(_send, r, pools=pools) for r in requests]
jobs = [gevent.spawn(_send, r) for r in requests]
gevent.joinall(jobs)

return [r.response for r in requests]
Expand Down

0 comments on commit 5537902

Please sign in to comment.