Skip to content

Instantly share code, notes, and snippets.

@vad
Created February 3, 2011 17:08
Show Gist options
  • Save vad/809786 to your computer and use it in GitHub Desktop.
Save vad/809786 to your computer and use it in GitHub Desktop.
from gevent import monkey
monkey.patch_all()
from gevent.pool import Group
from urllib import urlopen
l = ["http://www.google.com",]*20
def get(url):
content = urlopen(url).read()
return True
g = Group()
for result in g.imap_unordered(get, l):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment