<div><span style="background-color: transparent; ">As I understand it gevent is about pseudo-threads, not threads, so you have to be running the gevent eventloop. Greenlets do not run in the background. </span><span style="background-color: transparent; "> </span><span style="background-color: transparent; "> </span></div>
<div><span style="background-color: transparent; "><br></span></div><div><span style="background-color: transparent; ">That would mean that you have to integrate IPython with the greenlet eventloop, as we do currently with various GUI eventloops via code in IPython.lib.inputhook.</span></div>
<div><span style="background-color: transparent; "><br></span></div><div><span style="background-color: transparent; ">I find replacing IPython.embed() with time.sleep(10), which is perfectly equivalent as far as the greenlets are concerned, also prevents the greenlet from ever</span></div>
<div>firing, so I presume there is some eventloop that must be called.</div><div><br></div><div>-MinRK<br><br><div class="gmail_quote">On Wed, Oct 26, 2011 at 08:47, Thomas Kluyver <span dir="ltr"><<a href="mailto:takowl@gmail.com">takowl@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><div class="gmail_quote">On 26 October 2011 16:27, Dave Foster <span dir="ltr"><<a href="mailto:dave.foster@gmail.com" target="_blank">dave.foster@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>No, no errors, IPython seems to be running just fine. What I'm missing<br>
is the "worker" greenlet actually running. I was hoping that while I'm<br>
in the shell, it would still run the greenlet and spit out the string<br>
without me having to explicitly yield control back to the hub.</div></blockquote></div><br></div>I'm not familiar with gevent, but I wonder if it is actually running, but unable to write to stdout for whatever reason. I can't think that IPython should be interfering with it. Have you tried with a worker loop writing a file or something?<br>
<br>a = 0<br>while True:<br> time.sleep(2)<br> with open("test","w") as f:<br> f.write(a)<br> a += 1<br>
<br>_______________________________________________<br>
IPython-User mailing list<br>
<a href="mailto:IPython-User@scipy.org">IPython-User@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-user" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-user</a><br>
<br></blockquote></div><br></div>