Skip to content

Instantly share code, notes, and snippets.

@radiosilence
Created April 2, 2010 13:41
Show Gist options
  • Save radiosilence/353145 to your computer and use it in GitHub Desktop.
Save radiosilence/353145 to your computer and use it in GitHub Desktop.
import gevent
def hello( name ):
time.sleep(5)
return "Hello, %s!" % name
if __name__ == '__main__':
names = [ "James", "Ruth" ]
jobs = [ gevent.spawn( hello, name ) for name in names ]
gevent.joinall( jobs )
for job in jobs:
print job.value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment