Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Doc/library/asyncio-eventloop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1917,6 +1917,17 @@ By default asyncio is configured to use :class:`EventLoop`.
methods that an alternative implementation of ``AbstractEventLoop``
should have defined.

.. class:: BaseEventLoop

A base class that partially implements :class:`AbstractEventLoop`
to simplify writing custom event loops.

It provides default implementations of many :class:`AbstractEventLoop`
methods, so subclasses have fewer methods to implement themselves.
In return, a subclass is expected to implement a number of internal,
protected methods.
See :ref:`writing_custom_event_loop` for more information.


Examples
========
Expand Down
11 changes: 7 additions & 4 deletions Doc/library/asyncio-extending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ classes. Asyncio has helpers that could be used to simplify this task.

Third-parties should reuse existing asyncio code with caution,
a new Python version is free to break backward compatibility
in *internal* part of API.
in the *internal* part of the API.


Writing a Custom Event Loop
.. _writing_custom_event_loop:

Writing a custom event loop
===========================

:class:`asyncio.AbstractEventLoop` declares very many methods. Implementing all them
from scratch is a tedious job.
:class:`asyncio.AbstractEventLoop` declares very many methods.
See :ref:`asyncio-event-loop-methods` for the full list.
Implementing them all from scratch is a tedious job.

A loop can get many common methods implementation for free by inheriting from
:class:`asyncio.BaseEventLoop`.
Expand Down
1 change: 0 additions & 1 deletion Doc/tools/.nitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Doc/c-api/init_config.rst
Doc/c-api/intro.rst
Doc/c-api/stable.rst
Doc/library/ast.rst
Doc/library/asyncio-extending.rst
Doc/library/email.charset.rst
Doc/library/email.parser.rst
Doc/library/http.cookiejar.rst
Expand Down
Loading