ipython / ipython/ipykernel

Custom `loop_factory` for `asyncio`

未关闭
#1,313 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
734
派生
412
平均合并
1 天 5 小时
30 天内合并 PR
8

描述

Hello,

I have a use-case where we'd like to run the `ipykernel` main-loop using a specific `asyncio.AbstractEventLoop` implementation (not the stdlib's default one). Since in the `main` branch of `ipykernel` the code was migrated to use `anyio`, I believe this boils down to passing a suitable `loop_factory` value in the `backend_options` passed to `anyio.run` (unless Trio mode is enabled, of course).

Would there be any interest in a patch to allow this, essentially adding a `--IPKernelApp.asyncio_loop_factory` config option (a `DottedObjectName`)?

Thanks!

贡献指南

打开贡献指南

调研方向

Start by tracing ipykernel's main-loop startup and the anyio.run call, focusing on how backend_options are passed and how Trio mode is selected. The requested change would expose an IPKernelApp.asyncio_loop_factory DottedObjectName and use it for asyncio mode while preserving Trio behavior; no specific files or tests are named.

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
backend
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。