ipython / ipython/ipykernel

Directing output of out external threads/processes to specific cells

オープン
#1,199 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
734
フォーク
412
平均マージ
1日 5時間
マージ済み PR(30日)
8

説明

https://github.com/ipython/ipykernel/pull/1186 made output of Python threads and asyncio tasks go to right cells. It would be interesting, although challenging to make it work for any thread/process (e.g. created from a C++ dependency).

Here are two possible options to consider:
- (a) define format (e.g. JSON-RPC) where each write to the stdio/stderr would be a packed with both target cell ID and a blob message (slight challenges related to buffering and format choice) - this is how LSP works.
- (b) allow to open file descriptors per-cell (*2 for stdout/stderr) and make their IDs easily accessible to the external processes for writing (this could use virtual filesystem on Linux), either by having an API return the file descriptor or by having them in predictable locations (e.g. relative to kernel runtime); of course the challenges here would be around OS-specific limits for watching files and the allowed number of open file descriptors.

Any thoughts on whether any of these would be in scope?

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。