@@ -23,7 +23,7 @@ To enable all debug checks for an application:
2323* Enable the asyncio debug mode globally by setting the environment variable
2424 :envvar: `PYTHONASYNCIODEBUG ` to ``1 ``, using ``-X dev `` command line option
2525 (see the :option: `-X ` option), or by calling
26- :meth: `AbstractEventLoop .set_debug `.
26+ :meth: `loop .set_debug `.
2727* Set the log level of the :ref: `asyncio logger <asyncio-logger >` to
2828 :py:data: `logging.DEBUG `. For example, call
2929 ``logging.basicConfig(level=logging.DEBUG) `` at startup.
@@ -35,11 +35,11 @@ Examples debug checks:
3535
3636* Log :ref: `coroutines defined but never "yielded from"
3737 <asyncio-coroutine-not-scheduled>`
38- * :meth: `~AbstractEventLoop .call_soon ` and :meth: `~AbstractEventLoop .call_at ` methods
38+ * :meth: `loop .call_soon ` and :meth: `loop .call_at ` methods
3939 raise an exception if they are called from the wrong thread.
4040* Log the execution time of the selector
4141* Log callbacks taking more than 100 ms to be executed. The
42- :attr: `AbstractEventLoop .slow_callback_duration ` attribute is the minimum
42+ :attr: `loop .slow_callback_duration ` attribute is the minimum
4343 duration in seconds of "slow" callbacks.
4444* :exc: `ResourceWarning ` warnings are emitted when transports and event loops
4545 are :ref: `not closed explicitly <asyncio-close-transports >`.
@@ -51,7 +51,7 @@ Examples debug checks:
5151
5252.. seealso ::
5353
54- The :meth: `AbstractEventLoop .set_debug ` method and the :ref: `asyncio logger
54+ The :meth: `loop .set_debug ` method and the :ref: `asyncio logger
5555 <asyncio-logger>`.
5656
5757
@@ -75,7 +75,7 @@ For example, write::
7575
7676Don't schedule directly a call to the :meth: `~Future.set_result ` or the
7777:meth: `~Future.set_exception ` method of a future with
78- :meth: `AbstractEventLoop .call_soon `: the future can be cancelled before its method
78+ :meth: `loop .call_soon `: the future can be cancelled before its method
7979is called.
8080
8181If you wait for a future, you should check early if the future was cancelled to
@@ -96,13 +96,14 @@ The :func:`shield` function can also be used to ignore cancellation.
9696Concurrency and multithreading
9797------------------------------
9898
99- An event loop runs in a thread and executes all callbacks and tasks in the same
100- thread. While a task is running in the event loop, no other task is running in
101- the same thread. But when the task uses ``await ``, the task is suspended
102- and the event loop executes the next task.
99+ An event loop runs in a thread (typically the main thread) and executes
100+ all callbacks and tasks in its thread. While a task is running in the
101+ event loop, no other task is running in the same thread. When a task
102+ executes an ``await `` expression, the task gets suspended and the
103+ event loop executes the next task.
103104
104105To schedule a callback from a different thread, the
105- :meth: `AbstractEventLoop .call_soon_threadsafe ` method should be used. Example::
106+ :meth: `loop .call_soon_threadsafe ` method should be used. Example::
106107
107108 loop.call_soon_threadsafe(callback, *args)
108109
@@ -122,7 +123,7 @@ To schedule a coroutine object from a different thread, the
122123 future = asyncio.run_coroutine_threadsafe(coro_func(), loop)
123124 result = future.result(timeout) # Wait for the result with a timeout
124125
125- The :meth: `AbstractEventLoop .run_in_executor ` method can be used with a thread pool
126+ The :meth: `loop .run_in_executor ` method can be used with a thread pool
126127executor to execute a callback in different thread to not block the thread of
127128the event loop.
128129
@@ -151,7 +152,7 @@ APIs like :ref:`protocols <asyncio-protocol>`.
151152
152153An executor can be used to run a task in a different thread or even in a
153154different process, to not block the thread of the event loop. See the
154- :meth: `AbstractEventLoop .run_in_executor ` method.
155+ :meth: `loop .run_in_executor ` method.
155156
156157.. seealso ::
157158
@@ -182,7 +183,7 @@ Detect coroutine objects never scheduled
182183----------------------------------------
183184
184185When a coroutine function is called and its result is not passed to
185- :func: `ensure_future ` or to the :meth: `AbstractEventLoop .create_task ` method,
186+ :func: `ensure_future ` or to the :meth: `loop .create_task ` method,
186187the execution of the coroutine object will never be scheduled which is
187188probably a bug. :ref: `Enable the debug mode of asyncio <asyncio-debug-mode >`
188189to :ref: `log a warning <asyncio-logger >` to detect it.
@@ -204,7 +205,7 @@ Output in debug mode::
204205 test()
205206
206207The fix is to call the :func: `ensure_future ` function or the
207- :meth: `AbstractEventLoop .create_task ` method with the coroutine object.
208+ :meth: `loop .create_task ` method with the coroutine object.
208209
209210.. seealso ::
210211
@@ -279,7 +280,7 @@ coroutine in another coroutine and use classic try/except::
279280 loop.run_forever()
280281 loop.close()
281282
282- Another option is to use the :meth: `AbstractEventLoop .run_until_complete `
283+ Another option is to use the :meth: `loop .run_until_complete `
283284function::
284285
285286 task = asyncio.ensure_future(bug())
0 commit comments