[IPython-dev] Converting ipython notebook from tornado to gevent?

Matthias BUSSONNIER bussonniermatthias@gmail....
Wed Jun 26 14:29:57 CDT 2013

Hi Steve, 

Le 26 juin 2013 à 20:32, Stephen Chan a écrit :

> Hi,
>    A group of us in Adam Arkin's KBase group at LBL has started working on a bioinformatics notebook using IPython Notebook. So far it looks like the ideal platform and we're glad to be finally under way.
>    One of the tasks we have on our todo list is to convert the IPython Notebook from Tornado to Gevent. We aren't considering this out of any perverse desire to create additional work for ourselves, but mainly because our existing deployment environment is based on uwsgi+gevent and the fact that gevent does a pretty good job of moving asynchrony back into the plumbing (where some of us think it belongs) so that we can code using a more conventional python idiom.
>    I think that this came up in f2f conversations with Fernando and MinRK, but I just wanted to bring it up again and ask if anyone considered a port to specifically to gevent, and if there's any idea of the scope of work? Is it something like a week of work for a solid python developer, or is it more like a couple of weeks or more? Are there any gotchas that may arise due to code written against tornado?

Sorry  if my answer does not totally respond to your question, 

I don't know what your exact requirement, and I'm not the most familiar with the handler side of IPython notebook. 
From the few things I read about tornado, I've seen here and there that integrating gevent with tornado should be possible in some cases. 
The big problem I think would be to keep the thing up to date with the following development. 

Not much should rely on tornado outside of the server, if it does it is probably a bug. It should even be possible I guess to write a server in another language that talk to the kernel/browser and write/read ipynb files to disk. as long as you conform to the web socket and zmq protocol it should be transparent for the client. 

Have you also considered a middleware ? You probably have your reasons to want to use gevent, but maybe what you might want is a bridge that only forward websocket/http(s) ? It will with higher chances stay compatible across version also. 


More information about the IPython-dev mailing list