``AsyncIOMainLoop`` creates an `.IOLoop` that corresponds to the current ``asyncio`` event loop (i.e. the one returned by ``asyncio.get_event_loop()``). .. deprecated:: 5.0 Now used automatically when appropriate; it is no longer necessary to refer to this class directly.
| 276 | |
| 277 | |
| 278 | class AsyncIOMainLoop(BaseAsyncIOLoop): |
| 279 | """``AsyncIOMainLoop`` creates an `.IOLoop` that corresponds to the |
| 280 | current ``asyncio`` event loop (i.e. the one returned by |
| 281 | ``asyncio.get_event_loop()``). |
| 282 | |
| 283 | .. deprecated:: 5.0 |
| 284 | |
| 285 | Now used automatically when appropriate; it is no longer necessary |
| 286 | to refer to this class directly. |
| 287 | |
| 288 | .. versionchanged:: 5.0 |
| 289 | |
| 290 | Closing an `AsyncIOMainLoop` now closes the underlying asyncio loop. |
| 291 | """ |
| 292 | |
| 293 | def initialize(self, **kwargs: Any) -> None: # type: ignore |
| 294 | super().initialize(asyncio.get_event_loop(), **kwargs) |
| 295 | |
| 296 | def _make_current(self) -> None: |
| 297 | # AsyncIOMainLoop already refers to the current asyncio loop so |
| 298 | # nothing to do here. |
| 299 | pass |
| 300 | |
| 301 | |
| 302 | class AsyncIOLoop(BaseAsyncIOLoop): |