@@ -261,7 +261,7 @@ <h2 id="synchronous-asynchronous-execution">Synchronous & Asynchronous Execu
261
261
Task 5 done
262
262
</ pre > </ code > </ p >
263
263
< p > In the synchronous case all the tasks are run sequentially,
264
- which results in the main programming < em > blocking</ em > (
264
+ which results in the main program < em > blocking</ em > (
265
265
i.e. pausing the execution of the main program )
266
266
while each task executes.</ p >
267
267
< p > The important parts of the program are the
@@ -319,7 +319,7 @@ <h2 id="synchronous-asynchronous-execution">Synchronous & Asynchronous Execu
319
319
< h2 id ="determinism "> Determinism</ h2 >
320
320
< p > As mentioned previously, greenlets are deterministic. Given the same
321
321
configuration of greenlets and the same set of inputs and they always
322
- produce the same output. For example lets spread a task across a
322
+ produce the same output. For example let's spread a task across a
323
323
multiprocessing pool compared to a gevent pool.</ p >
324
324
< pre >
325
325
< code class ="python ">
@@ -644,7 +644,7 @@ <h2 id="events">Events</h2>
644
644
</ code >
645
645
</ pre >
646
646
647
- < p > A extension of the Event object is the AsyncResult which
647
+ < p > An extension of the Event object is the AsyncResult which
648
648
allows you to send a value along with the wakeup call. This is
649
649
sometimes called a future or a deferred, since it holds a
650
650
reference to a future value that can be set on an arbitrary time
@@ -745,7 +745,7 @@ <h2 id="queues">Queues</h2>
745
745
counterpart, < code > put_nowait</ code > and
746
746
< code > get_nowait</ code > which will not block, but instead raise
747
747
either < code > gevent.queue.Empty</ code > or
748
- < code > gevent.queue.Full</ code > in the operation is not possible.</ p >
748
+ < code > gevent.queue.Full</ code > if the operation is not possible.</ p >
749
749
< p > In this example we have the boss running simultaneously to the
750
750
workers and have a restriction on the Queue that it can contain no
751
751
more than three elements. This restriction means that the < code > put</ code >
@@ -821,7 +821,7 @@ <h2 id="queues">Queues</h2>
821
821
</ pre > </ code > </ p >
822
822
< h2 id ="groups-and-pools "> Groups and Pools</ h2 >
823
823
< p > A group is a collection of running greenlets which are managed
824
- and scheduled together as group. It also doubles as parallel
824
+ and scheduled together as group. It also doubles as a parallel
825
825
dispatcher that mirrors the Python < code > multiprocessing</ code > library.</ p >
826
826
< pre > < code class ="python ">
827
827
import gevent
@@ -856,9 +856,9 @@ <h2 id="groups-and-pools">Groups and Pools</h2>
856
856
fizz
857
857
fizz
858
858
</ pre > </ code > </ p >
859
- < p > This is very usefull for managing groups of asynchronous tasks
860
- that.</ p >
861
- < p > As mentioned above Group also provides an API for dispatching
859
+ < p > This is very useful for managing groups of asynchronous tasks
860
+ that run in parallel .</ p >
861
+ < p > As mentioned above, Group also provides an API for dispatching
862
862
jobs to grouped greenlets and collecting their results in various
863
863
ways.</ p >
864
864
< pre > < code class ="python ">
@@ -963,8 +963,8 @@ <h2 id="groups-and-pools">Groups and Pools</h2>
963
963
< h2 id ="locks-and-semaphores "> Locks and Semaphores</ h2 >
964
964
< p > A semaphore is a low level synchronization primitive that allows
965
965
greenlets to coordinate and limit concurrent access or execution. A
966
- semaphore exposes two methods, < code > acquire</ code > and < code > release</ code > The
967
- difference between the number of times and a semaphore has been
966
+ semaphore exposes two methods, < code > acquire</ code > and < code > release</ code > .
967
+ The difference between the number of times and a semaphore has been
968
968
acquired and released is called the bound of the semaphore. If a
969
969
semaphore bound reaches 0 it will block until another greenlet
970
970
releases its acquisition.</ p >
@@ -1006,7 +1006,7 @@ <h2 id="locks-and-semaphores">Locks and Semaphores</h2>
1006
1006
Worker 5 acquired semaphore
1007
1007
Worker 5 released semaphore
1008
1008
</ pre > </ code > </ p >
1009
- < p > A semaphore with bound of 1 is known as a Lock. it provides
1009
+ < p > A semaphore with bound of 1 is known as a Lock. It provides
1010
1010
exclusive execution to one greenlet. They are often used to
1011
1011
ensure that resources are only in use at one time in the context
1012
1012
of a program.</ p >
@@ -1083,7 +1083,7 @@ <h2 id="gevent-zeromq">Gevent ZeroMQ</h2>
1083
1083
distributed applications. </ p >
1084
1084
< p > ZeroMQ provides a variety of socket primitives, the simplest of
1085
1085
which being a Request-Response socket pair. A socket has two
1086
- methods of interest < code > send</ code > and < code > recv</ code > , both of which are
1086
+ methods of interest: < code > send</ code > and < code > recv</ code > , both of which are
1087
1087
normally blocking operations. But this is remedied by a briliant
1088
1088
library by < a href ="https://github.com/traviscline "> Travis Cline</ a > which
1089
1089
uses gevent.socket to poll ZeroMQ sockets in a non-blocking
@@ -1451,4 +1451,4 @@ <h2 id="chat-server">Chat Server</h2>
1451
1451
</ div >
1452
1452
1453
1453
</ body >
1454
- </ html >
1454
+ </ html >
0 commit comments