File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1967,6 +1967,17 @@ By default asyncio is configured to use :class:`EventLoop`.
19671967 methods that an alternative implementation of ``AbstractEventLoop ``
19681968 should have defined.
19691969
1970+ .. class :: BaseEventLoop
1971+
1972+ A base class that partially implements :class: `AbstractEventLoop `
1973+ to simplify writing custom event loops.
1974+
1975+ It provides default implementations of many :class: `AbstractEventLoop `
1976+ methods, so subclasses have fewer methods to implement themselves.
1977+ In return, a subclass is expected to implement a number of internal,
1978+ protected methods.
1979+ See :ref: `writing_custom_event_loop ` for more information.
1980+
19701981
19711982Examples
19721983========
Original file line number Diff line number Diff line change @@ -12,14 +12,17 @@ classes. Asyncio has helpers that could be used to simplify this task.
1212
1313 Third-parties should reuse existing asyncio code with caution,
1414 a new Python version is free to break backward compatibility
15- in *internal * part of API.
15+ in the *internal * part of the API.
1616
1717
18- Writing a Custom Event Loop
18+ .. _writing_custom_event_loop :
19+
20+ Writing a custom event loop
1921===========================
2022
21- :class: `asyncio.AbstractEventLoop ` declares very many methods. Implementing all them
22- from scratch is a tedious job.
23+ :class: `asyncio.AbstractEventLoop ` declares very many methods.
24+ See :ref: `asyncio-event-loop-methods ` for the full list.
25+ Implementing them all from scratch is a tedious job.
2326
2427A loop can get many common methods implementation for free by inheriting from
2528:class: `asyncio.BaseEventLoop `.
Original file line number Diff line number Diff line change 44
55Doc/c-api/module.rst
66Doc/library/ast.rst
7- Doc/library/asyncio-extending.rst
87Doc/library/logging.config.rst
98Doc/library/logging.handlers.rst
109Doc/library/multiprocessing.rst
You can’t perform that action at this time.
0 commit comments