ipython / ipython/ipykernel

Custom `loop_factory` for `asyncio`

Đang mở
#1,313 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
734
Fork
412
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
8

Mô tả

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!

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
backend
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.