Last active
February 9, 2016 23:36
-
-
Save andrefsp/e6115b6de50de00eba1d to your computer and use it in GitHub Desktop.
Revisions
-
andrefsp renamed this gist
Feb 9, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
andrefsp created this gist
Feb 9, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ import gevent from gevent import monkey monkey.patch_all() import requests def fetch_request(url): print("fetching %s" % url) requests.get(url) print("Finish fetching %s" % url) jobs = [] for url in ("http://google.com", "http://facebook.com"): jobs.append(gevent.spawn(fetch_request, url)) gevent.joinall(jobs)