We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d5c236 commit 114345aCopy full SHA for 114345a
1 file changed
gevent_example.py
@@ -0,0 +1,8 @@
1
+
2
+import gevent
3
+from gevent import socket
4
+hosts = ['www.crappytaxidermy.com', 'www.sina.com.cn','www.sohu.com']
5
+jobs = [gevent.spawn(gevent.socket.gethostbyname, host) for host in hosts]
6
+gevent.joinall(jobs, timeout=5)
7
+for job in jobs:
8
+ print(job.value)
0 commit comments