Repository navigation
Asynch InProcessKernel - #7175
marcus-oscarsson wants to merge 5 commits into
Conversation
…onous evaluation of the code so that the client can continue to process events.
'kernel_info_reply' is also handled by the code below, which makes these two lines redundant.
are executing the code asynchronously.
QtAsyncInProcessKernelManager
|
Thanks @marcus-oscarsson . Unfortunately, this will conflict with a big refactor of the channels code that is (hopefully) just about to land (#7108), so you may need to redo it once that's in. I'm also not sure whether it makes sense for us to do this in IPython. The in-process kernel is already poorly supported, because we don't use it in any of our own code, and it somewhat goes against our idea of cleanly separating frontend and kernel in separate processes with a communication layer. So another kind of in-process kernel probably won't be well supported either. There's limited benefit to running code in a separate thread, because the GIL will slow down both user code and your application code. And we're not particularly fans of gevent either. I'll put this on the agenda for the dev meeting today. |
|
Allright, thanks for taking a look. I understand that it might seem somewhat unnecessary to use IPython in this way. I found it to be a really neat way to provide a interpreter that shares the same memory space as "main" application code. It makes it really easy to provide a UI with a python scripting facility, without the need of exporting your API through some service layer. I'm sure you get the idea, thanks in anyways and I'll take a look at #7108 when it lands |
|
We discussed this at the dev meeting today, and concluded that if you need changes in the existing code to make this possible, we're happy to merge those changes, but we'd prefer you to maintain the new subclasses for the async in-process kernel as a standalone project. Thanks! |
@marcus-oscarsson, do you have plans to request/made entry points using this same PR? |
|
Sorry for taking sometime to answer your comments, I have been away for quite some time. I will take a closer look at #7180 to see what changes that needs to be done. I need the feature for one of my own projects so I will probably continue to maintain this solution, if I don't find anything better/easier. Ill try to implement something and Ill get back to you guys if I have something I think might be worth merging. I will close this pull request and perhaps open a new one later. Happy new year ! |
|
Thanks for the feedback @marcus-oscarsson... happy new year for you too! |
The InProcessKernel can be really usefull, however the evaluation of the code is blocking which cuases
the application that embeds the kernel to freeze. This is a simple attempt to create a AsyncInProcessKernel and AsyncInProcessKernelManager that facilitates asynchronous evaluation of the code so that the client can continue to process events.
Thanks for all the great work you guys are putting in to this !