Skip to content

Asynch InProcessKernel - #7175

Closed
marcus-oscarsson wants to merge 5 commits into
ipython:masterfrom
marcus-oscarsson:asynch-inprocess
Closed

marcus-oscarsson wants to merge 5 commits into
ipython:masterfrom
marcus-oscarsson:asynch-inprocess

Conversation

@marcus-oscarsson

Copy link
Copy Markdown

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 !

…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.
@takluyver

Copy link
Copy Markdown
Member

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.

@marcus-oscarsson

Copy link
Copy Markdown
Author

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

@takluyver

Copy link
Copy Markdown
Member

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!

@damianavila

Copy link
Copy Markdown
Member

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?
If not, I think we can close this one... there is no real possibility to get this merged, so there is no need to keep it opened.

@marcus-oscarsson

Copy link
Copy Markdown
Author

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 !

@damianavila

Copy link
Copy Markdown
Member

Thanks for the feedback @marcus-oscarsson... happy new year for you too!

@minrk minrk modified the milestone: no action Jan 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants