<div class="gmail_quote">On Wed, Feb 2, 2011 at 2:15 AM, Kurt Spindler <span dir="ltr">&lt;<a href="mailto:kespindler@gmail.com">kespindler@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>I am trying to design a twisted application, (I&#39;m pretty new to twisted and networking in general) and I feel like I&#39;m not approaching it quite the right way and would appreciate your feedback. First part, is that I am trying to couple twisted with an existing graphics-type application, that already has it&#39;s own main loop, etc. Meaning, I need to be running other python code while I have the reactor running. Is the solution threading?</div>
</blockquote><div><br></div><div>I would guess so.  Otherwise, you may have to significantly rework the graphics lib to fit into twisted.  I was involved in a project where I joined cherrypy and twisted into a single process.  I ran each in a separate thread.  Note that you will need to become very familiar with callFromThread()---any twisted call you want to make from the graphics side will need to use this in case the reactor is blocking (e.g. stuck in a select() call).  Also, if the graphics lib either manipulates or relies on certain signal behavior, you may need to install your own signal handlers which do all the processing that both the graphics lib and twisted expect.  This is especially important if you start any processes from twisted (ProcessProtocol).</div>
<div><br></div><div>Cheers,</div><div><br>Jason</div><div><br></div></div>-- <br>Jason Rennie<br>Research Scientist, ITA Software<br>617-714-2645<br><a href="http://www.itasoftware.com/">http://www.itasoftware.com/</a><br>
<br>