Re: [jupyter] The relationship of IPYkernel & MultiKernelManager & KernelManager & BlockingClient

19 views
Skip to first unread message

Thomas Kluyver

unread,
May 15, 2017, 6:55:03 AM5/15/17
to Project Jupyter
On 14 May 2017 at 14:42, Narcissus Emi <eminar...@gmail.com> wrote:
After some more digs into the source of notebook's service/kernelmanager/handler/session, I find the relationship are as follows.

1: Session keeps the record and relationship of ipynb and kernel,it will do kernel startup and release and handling web session create.
2. Kernel part looks like only have interact with kernel's four port, that's hb/stdin/iopub ports.

And KernelManage is just a container(interface) which contains these four ports, and notebook do only expect to use these ports to run command(to be more specific shell port for sending cmd and iohub for stdin/stout/steer).

I think that's about right. I'd describe it as:

- KernelManager is responsible for starting/stopping/restarting a kernel (and for now, some operations like sending a Unix signal to it)
- MultiKernelManager keeps track of a collection of KernelManagers, one per running kernel.
- KernelClient is responsible for talking to a kernel. The notebook server does not actually use KernelClient, though.
- SessionManager tracks the relationship between a kernel and a notebook file. However, the word 'session' is used in a few different places in our code with somewhat different meanings - jupyter_client also includes a Session class, which is doing something quite different.

There is some code in ipykernel for an 'in process' kernel, but it doesn't fit in well with the overall architecture, it's a source of headaches, and I wouldn't recommend you use it. However, I wouldn't recommend doing what you're trying to do at all - I think it's likely to be less trouble all round to use an iOS device to connect to a standard notebook server running elsewhere.

Someone did previously make a notebook-on-iOS application, but I just looked at the website (http://www.computableapp.com/ ), and they pulled it a couple of years ago because there were too many problems.

Thomas
Reply all
Reply to author
Forward
0 new messages