Skip to content

Commit 31e4e58

Browse files
committed
Rebuilt.
1 parent 6d0ca98 commit 31e4e58

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

index.html

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ <h3 id="contributors">Contributors</h3>
194194
<a href="https://github.com/Lothiraldan">Boris Feld</a>
195195
<a href="https://github.com/youngsterxyf">youngsterxyf</a>
196196
<a href="https://github.com/ehebert">Eddie Hebert</a>
197-
<a href="http://notmyidea.org">Alexis Metaireau</a></p>
197+
<a href="http://notmyidea.org">Alexis Metaireau</a>
198+
<a href="https://github.com/djv">Daniel Velkov</a></p>
198199
<p>This is a collaborative document published under MIT license.
199200
Have something to add? See a typo? Fork and issue a
200201
pull request <a href="https://github.com/sdiehl/gevent-tutorial">Github</a>.
@@ -215,7 +216,7 @@ <h2 id="synchronous-asynchronous-execution">Synchronous &amp; Asynchronous Execu
215216
<em>asynchronously</em> instead of one at a time
216217
<em>synchronously</em>. A switch between the two
217218
executions is known as a <em>context switch</em>.</p>
218-
<p>A context switch in gevent done through
219+
<p>A context switch in gevent is done through
219220
<em>yielding</em>. In this case example we have
220221
two contexts which yield to each other through invoking
221222
<code>gevent.sleep(0)</code>.</p>
@@ -338,16 +339,16 @@ <h2 id="synchronous-asynchronous-execution">Synchronous &amp; Asynchronous Execu
338339
Task 8 done
339340
Task 9 done
340341
Asynchronous:
341-
Task 1 done
342+
Task 0 done
343+
Task 2 done
342344
Task 6 done
343345
Task 5 done
344-
Task 0 done
345-
Task 9 done
346-
Task 8 done
347-
Task 7 done
348346
Task 4 done
347+
Task 7 done
348+
Task 8 done
349+
Task 9 done
350+
Task 1 done
349351
Task 3 done
350-
Task 2 done
351352
</pre></code></p>
352353
<p>In the synchronous case all the tasks are run sequentially,
353354
which results in the main programming <em>blocking</em> (
@@ -506,6 +507,7 @@ <h2 id="spawning-threads">Spawning Threads</h2>
506507
<p>In addition to using the base Greenlet class, you may also subclass
507508
Greenlet class and overload the <code>_run</code> method.</p>
508509
<pre><code class="python">
510+
import gevent
509511
from gevent import Greenlet
510512

511513
class MyGreenlet(Greenlet):
@@ -922,11 +924,12 @@ <h2 id="actors">Actors</h2>
922924
one very simply using a Queue inside of a subclassed Greenlet.</p>
923925
<pre>
924926
<code class="python">import gevent
927+
from gevent.queue import Queue
925928

926929
class Actor(gevent.Greenlet):
927930

928931
def __init__(self):
929-
self.inbox = queue.Queue()
932+
self.inbox = Queue()
930933
Greenlet.__init__(self)
931934

932935
def receive(self, message):
@@ -1075,7 +1078,7 @@ <h2 id="wsgi-servers">WSGI Servers</h2>
10751078
instead of libev. Libevent included a fast HTTP server which was
10761079
used by gevent's <code>wsgi</code> server. </p>
10771080
<p>In gevent 1.0.x there is no http server included. Instead
1078-
<code>gevent.wsgi</code> it is now an alias for the pure Python server in
1081+
<code>gevent.wsgi</code> is now an alias for the pure Python server in
10791082
<code>gevent.pywsgi</code>.</p>
10801083
<h2 id="streaming-servers">Streaming Servers</h2>
10811084
<p><strong>If you are using gevent 1.0.x, this section does not apply</strong></p>

0 commit comments

Comments
 (0)