Created
February 1, 2013 19:52
-
-
Save EdLeafe/4693648 to your computer and use it in GitHub Desktop.
This file contains 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 characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import eventlet | |
import requests | |
import time | |
url = "http://daboserver.com/eventlet" | |
def getit(seq): | |
req = requests.request("GET", url) | |
print "%s: %s - %s" % (seq, req.text, time.ctime()) | |
pool = eventlet.GreenPool(20) | |
for ii in xrange(100): | |
print "Spawning #%s at %s" % (ii, time.ctime()) | |
pool.spawn_n(getit, ii) | |
pool.waitall() | |
print "DONE at", time.ctime() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment