Open takluyver opened 7 years ago
I would like the discovery mechanism to be able to pick the KernelManager, because I really want to have things like remote kernels that don't involve shelling out to subprocesses, which I think is the wrong approach for remote kernels, and the provider ought to be able to be responsible for port selection as well, which is easier if it can specify the KernelManager.
Looking at qtconsole, there is very little in QtKernelManager, and I think that probably be handled via fairly clear over-the-top mechanisms instead of the mixin subclassing we do in QtConsole. Most of the logic is really in the KernelClient, which the application does need to control. So I think we should examine this from the QtConsole perspective, where:
As long as these are things that the QtConsole can accomplish, we should be okay. Or is there something else?
We could try to more clearly isolate what a custom KernelManager might do by defining a separate class, but I think defining the appropriate base set of methods to define ought to be enough.
The new kernel discovery machinery added in #261 allows a kernel provider to return an instance of KernelManager or a subclass when a frontend wants to start a kernel. This is meant to allow flexibility such as launching a kernel on a remote machine.
However, while working on the Qt console I remembered that it starts kernels through its own QtKernelManager subclass, which integrates with the Qt framework (e.g. using Qt signals for events). So it would be incompatible with the kernel discovery framework, because the managers it gets from that will not be Qt managers.
Options
I would say that option 2 is neatest if we can figure cleanly separating two API layers, but I'm not sure we can. If not, option 1 is probably the fallback.