Skip to content

Commit 6a9f05f

Browse files
committed
Rebuilt & updated contribs.
1 parent 8a8eff8 commit 6a9f05f

File tree

2 files changed

+20
-23
lines changed

2 files changed

+20
-23
lines changed

index.html

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ <h3 class="author">
133133
</header>
134134

135135
<blockquote>
136-
gevent is a concurrency library based around libev. It provides a clean API for a variety of concurrency and network related tasks.
136+
gevent is a concurrency library based around <a href="http://software.schmorp.de/pkg/libev.html">libev</a>. It provides a clean API for a variety of concurrency and network related tasks.
137137
</blockquote>
138138

139139
<div class="toc">
@@ -171,7 +171,6 @@ <h3 class="author">
171171
<li><a href="#long-polling">Long Polling</a></li>
172172
<li><a href="#websockets">Websockets</a></li>
173173
<li><a href="#chat-server">Chat Server</a></li>
174-
<li><a href="#license">License</a></li>
175174
</ul>
176175
</li>
177176
</ul>
@@ -191,7 +190,9 @@ <h3 id="contributors">Contributors</h3>
191190
<a href="https://github.com/brunoqc">Bruno Bigras</a>
192191
<a href="https://github.com/dripton">David Ripton</a>
193192
<a href="https://github.com/traviscline">Travis Cline</a>
194-
<a href="https://github.com/Lothiraldan">Boris Feld</a></p>
193+
<a href="https://github.com/Lothiraldan">Boris Feld</a>
194+
<a href="https://github.com/youngsterxyf">youngsterxyf</a>
195+
<a href="https://github.com/ehebert">Eddie Hebert</a></p>
195196
<p>This is a collaborative document published under MIT license.
196197
Have something to add? See a typo? Fork and issue a
197198
pull request <a href="https://github.com/sdiehl/gevent-tutorial">Github</a>.
@@ -203,7 +204,7 @@ <h2 id="greenlets">Greenlets</h2>
203204
Greenlets all run inside of the OS process for the main
204205
program but are scheduled cooperatively. This differs from any of
205206
the real parallelism constructs provided by <code>multiprocessing</code> or
206-
<code>multithreading</code> libraries which do spin processes and posix threads
207+
<code>multithreading</code> libraries which do spin processes and POSIX threads
207208
which are truly parallel.</p>
208209
<h2 id="synchronous-asynchronous-execution">Synchronous &amp; Asynchronous Execution</h2>
209210
<p>The core idea of concurrency is that a larger task can be broken
@@ -336,16 +337,16 @@ <h2 id="synchronous-asynchronous-execution">Synchronous &amp; Asynchronous Execu
336337
Task 8 done
337338
Task 9 done
338339
Asynchronous:
340+
Task 6 done
339341
Task 0 done
340-
Task 2 done
341342
Task 5 done
343+
Task 3 done
344+
Task 8 done
345+
Task 2 done
346+
Task 4 done
342347
Task 7 done
343348
Task 1 done
344-
Task 3 done
345-
Task 6 done
346349
Task 9 done
347-
Task 4 done
348-
Task 8 done
349350
</pre></code></p>
350351
<p>In the synchronous case all the tasks are run sequentially,
351352
which results in the main programming <em>blocking</em> (
@@ -451,8 +452,8 @@ <h2 id="determinism">Determinism</h2>
451452
non-determinism can creep into your program when you beging to
452453
interact with outside services such as sockets and files. Thus
453454
even though green threads are a form of "deterministic
454-
concurrency", they still can experience some of the smae problems
455-
that posix threads and processes experience.</p>
455+
concurrency", they still can experience some of the same problems
456+
that POSIX threads and processes experience.</p>
456457
<p>The perennial problem involved with concurrency is known as a
457458
<em>race condition</em>. Simply put is when two concurrent threads
458459
/ processes depend on some shared resource but also attempt to
@@ -621,6 +622,7 @@ <h2 id="timeouts">Timeouts</h2>
621622
Greenlet.</p>
622623
<pre>
623624
<code class="python">
625+
import gevent
624626
from gevent import Timeout
625627

626628
seconds = 10
@@ -995,7 +997,7 @@ <h2 id="gevent-zeromq">Gevent ZeroMQ</h2>
995997

996998
def server():
997999
server_socket = context.socket(zmq.REQ)
998-
server_socket.bind("tcp://*:5000")
1000+
server_socket.bind("tcp://127.0.0.1:5000")
9991001

10001002
for request in range(1,10):
10011003
server_socket.send("Hello")
@@ -1143,8 +1145,10 @@ <h2 id="wsgi-servers">WSGI Servers</h2>
11431145

11441146
<h2 id="long-polling">Long Polling</h2>
11451147
<pre>
1146-
<code class="python">from gevent.queue import Queue, Empty
1148+
<code class="python">import gevent
1149+
from gevent.queue import Queue, Empty
11471150
from gevent.pywsgi import WSGIServer
1151+
import simplejson as json
11481152

11491153
data_source = Queue()
11501154

@@ -1335,10 +1339,6 @@ <h2 id="chat-server">Chat Server</h2>
13351339
http.serve_forever()
13361340
</code>
13371341
</pre>
1338-
1339-
<h2 id="license">License</h2>
1340-
<p>This is a collaborative document published under MIT license. Forking
1341-
on <a href="https://github.com/sdiehl/gevent-tutorial">GitHub</a> is encouraged</p>
13421342
</div>
13431343
</body>
13441344
</html>

tutorial.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ In chronological order of contribution:
1919
[David Ripton](https://github.com/dripton)
2020
[Travis Cline](https://github.com/traviscline)
2121
[Boris Feld](https://github.com/Lothiraldan)
22+
[youngsterxyf](https://github.com/youngsterxyf)
23+
[Eddie Hebert](https://github.com/ehebert)
2224

2325
This is a collaborative document published under MIT license.
2426
Have something to add? See a typo? Fork and issue a
@@ -764,7 +766,7 @@ context = zmq.Context()
764766

765767
def server():
766768
server_socket = context.socket(zmq.REQ)
767-
server_socket.bind("tcp://*:5000")
769+
server_socket.bind("tcp://127.0.0.1:5000")
768770

769771
for request in range(1,10):
770772
server_socket.send("Hello")
@@ -1102,8 +1104,3 @@ if __name__ == "__main__":
11021104
http.serve_forever()
11031105
</code>
11041106
</pre>
1105-
1106-
## License
1107-
1108-
This is a collaborative document published under MIT license. Forking
1109-
on <a href="https://github.com/sdiehl/gevent-tutorial">GitHub</a> is encouraged

0 commit comments

Comments
 (0)