Permalink
Browse files

Fix typo, and clarify what yielding write() means

  • Loading branch information...
1 parent f21cc82 commit 47afe8734fbf2ea84d48019e745de5985caf9f95 @jtackaberry jtackaberry committed Jan 21, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 doc/async/coroutines.rst
@@ -57,7 +57,7 @@ To recap, if a coroutine yields:
can run (such as other timers, I/O handlers, etc.) and resumed on the next
main loop iteration.
* an :class:`~kaa.InProgress` object: control is returned to the main loop and
- the coroutine is resumed with the yielded InProgress is finished. Inside
+ the coroutine is resumed when the yielded InProgress is finished. Inside
the coroutine, the yield call "returns" the value that InProgress was finished
with.
* any other value: the coroutine terminates, and the InProgress the coroutine
@@ -119,8 +119,8 @@ In the above example, the difference between threaded functions
:meth:`~kaa.IOChannel.read`) is transparent. Both return InProgress objects. (As
an aside, we didn't really need to yield socket.write() because writes are
queued and written to the socket when it becomes writable. However, yielding a
-write means that when the coroutine resumes, the data has been
-written.)
+write means that when the coroutine resumes, the data has been fully sent to the
+socket.)
To more clearly see the benefit of implementing the above example as a coroutine,
consider the following code, which is rewritten using the more traditional approach

0 comments on commit 47afe87

Please sign in to comment.