Guys, now that I see this and the past conversations about SA and Twisted, and now that I&#39;ve read some more about the non-blocking concepts, I think that I&#39;am not doing things the best way<br><br> I am doing this:<br>

<br>1. Twisted  IMAP4 Client to read my mails<br>2. Inside this client I import a module that contains some funtions that parse the email via re<br>3. Also inside the client I import a module that makes a DB connection and insert the data parsed from those emails, all this via SQL using mapped tables. <br>

<br>I&#39;m almost sure that I&#39;m breacking the hole twisted concept doing this thisway , do you guys have any advice for me<br><br>Thanks<br><div class="gmail_quote">2010/5/5 Chris Withers <span dir="ltr">&lt;<a href="mailto:chris@simplistix.co.uk" target="_blank">chris@simplistix.co.uk</a>&gt;</span><br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Doug Farrell wrote:<br>
&gt;<br>
&gt; I’ve been doing some searching about how to get SQLAlchemy and Twisted<br>
&gt; working together in a Twisted application.<br>
<br>
</div>Short version: to be safe, anything that touches any SQLAlchemy-mapped<br>
object needs to be run in its own thread. Any query or access of an<br>
attribute of a mapped object may result in a blocking sql query. (aka:<br>
twisted doesn&#39;t play nice with orms)<br>
<div><br>
&gt; definitive answer. The most promising one I’ve run across concerns<br>
&gt; running the SQLAlchemy queries in a separate process (rather than a<br>
&gt; separate thread) and communicating the queries between the Twisted<br>
&gt; application in one process and the SQLAlchemy application in another.<br>
<br>
</div>That seems a little odd.<br>
What would be the IPC?<br>
How would the &quot;sqlachemy application&quot; be run?<br>
<div><br>
&gt; 1)      Would the SQLAlchemy process also be a Twisted application with<br>
&gt; all the queries running as deferreds in the main thread, and blocking?<br>
<br>
</div>What do you men by &quot;all the queries&quot;?<br>
<div><br>
&gt; Thanks in advance for any help!<br>
<br>
</div>In my case, since most of the app I&#39;m working on is &quot;web requested&quot;<br>
(either xmlrpc or http), I just agve up and used a good wsgi stack<br>
(repoze.bfg in my case) and munge other incoming requests into wsgi<br>
requests.<br>
<br>
Twisted&#39;s wsgi server runs each request in its own thread, so be it.<br>
<br>
cheers,<br>
<font color="#888888"><br>
Chris<br>
</font><div><div></div><div><br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com" target="_blank">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><a href="http://celord.blogspot.com/" target="_blank">http://celord.blogspot.com/</a><br>