Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

tiny map() refactoring #370

Merged
merged 1 commit into from

2 participants

@piotr-dobrogost

No description provided.

@kennethreitz

Thanks!

@kennethreitz kennethreitz merged commit b525dc2 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 20, 2012
  1. @piotr-dobrogost

    tiny map() refactoring

    piotr-dobrogost authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 6 deletions.
  1. +2 −6 requests/async.py
View
8 requests/async.py
@@ -78,12 +78,8 @@ def map(requests, prefetch=True, size=None):
requests = list(requests)
- if size:
- pool = Pool(size)
- jobs = [pool.spawn(r.send) for r in requests]
- else:
- jobs = [gevent.spawn(r.send) for r in requests]
-
+ pool = Pool(size) if size else None
+ jobs = [send(r, pool) for r in requests]
gevent.joinall(jobs)
if prefetch:
Something went wrong with that request. Please try again.