@@ -351,7 +351,7 @@ <h2 id="synchronous-asynchronous-execution">Synchronous & Asynchronous Execu
351
351
Task 2 done
352
352
</ pre > </ code > </ p >
353
353
< p > In the synchronous case all the tasks are run sequentially,
354
- which results in the main programming < em > blocking</ em > (
354
+ which results in the main program < em > blocking</ em > (
355
355
i.e. pausing the execution of the main program )
356
356
while each task executes.</ p >
357
357
< p > The important parts of the program are the
@@ -409,7 +409,7 @@ <h2 id="synchronous-asynchronous-execution">Synchronous & Asynchronous Execu
409
409
< h2 id ="determinism "> Determinism</ h2 >
410
410
< p > As mentioned previously, greenlets are deterministic. Given the same
411
411
configuration of greenlets and the same set of inputs and they always
412
- produce the same output. For example lets spread a task across a
412
+ produce the same output. For example let's spread a task across a
413
413
multiprocessing pool compared to a gevent pool.</ p >
414
414
< pre >
415
415
< code class ="python ">
@@ -734,7 +734,7 @@ <h2 id="events">Events</h2>
734
734
</ code >
735
735
</ pre >
736
736
737
- < p > A extension of the Event object is the AsyncResult which
737
+ < p > An extension of the Event object is the AsyncResult which
738
738
allows you to send a value along with the wakeup call. This is
739
739
sometimes called a future or a deferred, since it holds a
740
740
reference to a future value that can be set on an arbitrary time
@@ -835,7 +835,7 @@ <h2 id="queues">Queues</h2>
835
835
counterpart, < code > put_nowait</ code > and
836
836
< code > get_nowait</ code > which will not block, but instead raise
837
837
either < code > gevent.queue.Empty</ code > or
838
- < code > gevent.queue.Full</ code > in the operation is not possible.</ p >
838
+ < code > gevent.queue.Full</ code > if the operation is not possible.</ p >
839
839
< p > In this example we have the boss running simultaneously to the
840
840
workers and have a restriction on the Queue that it can contain no
841
841
more than three elements. This restriction means that the < code > put</ code >
@@ -911,7 +911,7 @@ <h2 id="queues">Queues</h2>
911
911
</ pre > </ code > </ p >
912
912
< h2 id ="groups-and-pools "> Groups and Pools</ h2 >
913
913
< p > A group is a collection of running greenlets which are managed
914
- and scheduled together as group. It also doubles as parallel
914
+ and scheduled together as group. It also doubles as a parallel
915
915
dispatcher that mirrors the Python < code > multiprocessing</ code > library.</ p >
916
916
< pre > < code class ="python ">
917
917
import gevent
@@ -946,9 +946,9 @@ <h2 id="groups-and-pools">Groups and Pools</h2>
946
946
fizz
947
947
fizz
948
948
</ pre > </ code > </ p >
949
- < p > This is very usefull for managing groups of asynchronous tasks
950
- that.</ p >
951
- < p > As mentioned above Group also provides an API for dispatching
949
+ < p > This is very useful for managing groups of asynchronous tasks
950
+ that run in parallel .</ p >
951
+ < p > As mentioned above, Group also provides an API for dispatching
952
952
jobs to grouped greenlets and collecting their results in various
953
953
ways.</ p >
954
954
< pre > < code class ="python ">
@@ -1053,8 +1053,8 @@ <h2 id="groups-and-pools">Groups and Pools</h2>
1053
1053
< h2 id ="locks-and-semaphores "> Locks and Semaphores</ h2 >
1054
1054
< p > A semaphore is a low level synchronization primitive that allows
1055
1055
greenlets to coordinate and limit concurrent access or execution. A
1056
- semaphore exposes two methods, < code > acquire</ code > and < code > release</ code > The
1057
- difference between the number of times and a semaphore has been
1056
+ semaphore exposes two methods, < code > acquire</ code > and < code > release</ code > .
1057
+ The difference between the number of times and a semaphore has been
1058
1058
acquired and released is called the bound of the semaphore. If a
1059
1059
semaphore bound reaches 0 it will block until another greenlet
1060
1060
releases its acquisition.</ p >
@@ -1096,7 +1096,7 @@ <h2 id="locks-and-semaphores">Locks and Semaphores</h2>
1096
1096
Worker 5 acquired semaphore
1097
1097
Worker 5 released semaphore
1098
1098
</ pre > </ code > </ p >
1099
- < p > A semaphore with bound of 1 is known as a Lock. it provides
1099
+ < p > A semaphore with bound of 1 is known as a Lock. It provides
1100
1100
exclusive execution to one greenlet. They are often used to
1101
1101
ensure that resources are only in use at one time in the context
1102
1102
of a program.</ p >
@@ -1173,7 +1173,7 @@ <h2 id="gevent-zeromq">Gevent ZeroMQ</h2>
1173
1173
distributed applications. </ p >
1174
1174
< p > ZeroMQ provides a variety of socket primitives, the simplest of
1175
1175
which being a Request-Response socket pair. A socket has two
1176
- methods of interest < code > send</ code > and < code > recv</ code > , both of which are
1176
+ methods of interest: < code > send</ code > and < code > recv</ code > , both of which are
1177
1177
normally blocking operations. But this is remedied by a briliant
1178
1178
library by < a href ="https://github.com/traviscline "> Travis Cline</ a > which
1179
1179
uses gevent.socket to poll ZeroMQ sockets in a non-blocking
0 commit comments