Comment 2 for bug 300218

Revision history for this message
Vishal Vatsa (vvatsa) wrote : Re: [Bug 300218] Re: IPython.kernel.client cannot be imported inside an engine

Just wondering, if the problem is that there is already another reactor
running so can't we just use the asyncclient.

I ran this StringTask:
"from IPython.kernel import asyncclient ; doc_str = asyncclient.__docformat__"

I am sure using asyncclient has its own set of complications.

-vishal

2009/4/14 Brian Granger <email address hidden>:
> Fixing this will require that the core be thread safe and that the
> reactor runs in a different thread from user code.  This should happen
> this summer.
>
> ** Changed in: ipython
>   Importance: Undecided => Medium
>
> ** Changed in: ipython
>       Status: New => Confirmed
>
> ** Changed in: ipython
>     Assignee: (unassigned) => Brian Granger (ellisonbg)
>
> --
> IPython.kernel.client cannot be imported inside an engine
> https://bugs.launchpad.net/bugs/300218
> You received this bug notification because you are a member of IPython
> Developers, which is subscribed to IPython.
>
> Status in IPython - Enhanced Interactive Python: Confirmed
>
> Bug description:
> Importing IPython.kernel.client in an engine doesn't work.
> The twisted reactor is started for the controller and engine
> automatically when they start and for the client when
> IPython.kernel.client is imported. The problem is that when executing import
> IPython.kernel.client script in the engine, the engine already has the reactor running,
> and the import tries to start the reactor again. This causes
> a the ipengine<->ipcontroller communication to fail on
> subsequently executed commands.
>
> A typical use case when one needs to import IPython.kernel.client in the
> engines, is when one wants to use one of the engines as a  client connected
> to another ipcontroller, and it seems impossible to do it,
> if one cannot import the client in one of the engines.
>