Skip to content

Instantly share code, notes, and snippets.

@EdLeafe
Created February 1, 2013 19:52
Show Gist options
  • Save EdLeafe/4693648 to your computer and use it in GitHub Desktop.
Save EdLeafe/4693648 to your computer and use it in GitHub Desktop.
#!/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