[IPython-dev] ipython embedded in twisted, no threads
Mon Apr 16 01:31:27 CDT 2007
[apologies if this arrives twice, posting via gmane didn't work - yet.]
attached is an ugly first attempt at embedding IPython in a twisted
application without using threads.
twisted.internet.stdio and a LineReceiver implementation are responsible
for getting input events.
I had to subclass the IPython shell and rearrange code to
create a non-blocking callback interface (splitting on the main,
blocking, raw_input call).
It's far from perfect: readline functionality is missing (no commandline
navigation, history navigation, completion), and sometimes continuation
lines eat the input counter (In ... In).
Would IPython developers be interested in patches that allow a less ugly
version of such a callback-friendly subclass? ;-)
The basic idea: refactor the main loop (InteractiveShell.interact) to::
(I think it might also be interesting for the frontend to the IPython
parallel computing effort, which uses twisted.)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 13037 bytes
Desc: not available
Url : http://lists.ipython.scipy.org/pipermail/ipython-dev/attachments/20070416/abe920f2/attachment.py
More information about the IPython-dev