@@ -10,7 +10,7 @@ recommended patterns.
1010
1111You might be curious about some key :mod: `!asyncio ` concepts.
1212You'll be comfortably able to answer these questions by the end of this
13- article.
13+ article:
1414
1515- What's happening behind the scenes when an object is ``await ``\ ed?
1616- How does :mod: `!asyncio ` differentiate between a task which doesn't need
@@ -22,7 +22,7 @@ article.
2222.. seealso ::
2323
2424 The `guide <https://github.com/anordin95/a-conceptual-overview-of-asyncio/
25- tree/main> `_ which inspired this HOWTO article.
25+ tree/main> `_ that inspired this HOWTO article.
2626
2727--------------------------------------------
2828A conceptual overview part 1: the high-level
@@ -45,14 +45,14 @@ done comes from the respect and cooperation of its teammates.
4545In more technical terms, the event loop contains a queue of jobs to be run.
4646Some jobs are added directly by you, and some indirectly by :mod: `!asyncio `.
4747The event loop pops a job from the queue and invokes it (or "gives it control"),
48- similar to calling a function, then that job runs.
48+ similar to calling a function, and then that job runs.
4949Once it pauses or completes, it returns control to the event loop.
5050The event loop will then move on to the next job in its queue and invoke it.
5151This process repeats indefinitely.
5252Even if the queue is empty, the event loop continues to cycle (somewhat
5353aimlessly).
5454
55- Effective execution relies on tasks sharing well: a greedy job could hog
55+ Effective execution relies on tasks sharing well; a greedy job could hog
5656control and leave the other tasks to starve, rendering the overall event loop
5757approach rather useless.
5858
@@ -255,7 +255,7 @@ A conceptual overview part 2: the nuts and bolts
255255Part 2 goes into detail on the mechanisms :mod: `!asyncio ` uses to manage
256256control flow.
257257This is where the magic happens.
258- You'll come away from this section knowing what await does behind the scenes
258+ You'll come away from this section knowing what `` await `` does behind the scenes
259259and how to make your own asynchronous operators.
260260
261261================================================
@@ -269,8 +269,8 @@ resume a coroutine.
269269If the coroutine was paused and is now being resumed, the argument ``arg ``
270270will be sent in as the return value of the ``yield `` statement which originally
271271paused it.
272- If the coroutine is being used for the first time, as opposed to being resumed,
273- arg must be ``None ``.
272+ If the coroutine is being used for the first time ( as opposed to being resumed)
273+ `` arg `` must be ``None ``.
274274
275275:ref: `yield <yieldexpr >`, like usual, pauses execution and returns control
276276to the caller.
@@ -359,15 +359,15 @@ and the object is a way to keep an eye on that something.
359359
360360A future has a few important attributes. One is its state which can be either
361361"pending", "cancelled" or "done".
362- Another is its result which is set when the state transitions to done.
362+ Another is its result, which is set when the state transitions to done.
363363Unlike a coroutine, a future does not represent the actual computation to be
364364done; instead, it represents the status and result of that computation, kind of
365365like a status light (red, yellow or green) or indicator.
366366
367367:class: `asyncio.Task ` subclasses :class: `asyncio.Future ` in order to gain
368368these various capabilities.
369369The prior section said tasks store a list of callbacks, which wasn't entirely
370- true .
370+ correct .
371371It's actually the ``Future `` class that implements this logic which ``Task ``
372372inherits.
373373
@@ -498,4 +498,4 @@ For reference, you could implement it without futures, like so::
498498
499499But, that's all for now. Hopefully you're ready to more confidently dive into
500500some async programming or check out advanced topics in the
501- :mod: `docs <asyncio> `.
501+ :mod: `rest of the documentation <asyncio> `.
0 commit comments