Skip to content

Instantly share code, notes, and snippets.

@djoreilly
Created March 21, 2013 13:47
Show Gist options
  • Save djoreilly/5213122 to your computer and use it in GitHub Desktop.
Save djoreilly/5213122 to your computer and use it in GitHub Desktop.
import eventlet
def foo(name):
for i in range(3):
print "foo(%s): i=%d" % (name, i)
eventlet.sleep()
f1 = eventlet.spawn(foo, 'A')
f2 = eventlet.spawn(foo, 'B')
for i in range(3):
print "main: i=%d" % i
eventlet.sleep()
f1.wait()
f2.wait()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment