You might also check out sAsync: <a href="http://sasync.org/">http://sasync.org/</a><br><br>This was a project apparently abandoned (?) by the original author, but it's recently been picked up by someone else.<br><br>Kevin Horn<br>
<br><div class="gmail_quote">On Thu, May 6, 2010 at 2:04 PM, César García <span dir="ltr"><<a href="mailto:celord@gmail.com">celord@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Guys, now that I see this and the past conversations about SA and Twisted, and now that I've read some more about the non-blocking concepts, I think that I'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'm almost sure that I'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"><<a href="mailto:chris@simplistix.co.uk" target="_blank">chris@simplistix.co.uk</a>></span><div>
<div></div><div class="h5"><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>
><br>
> I’ve been doing some searching about how to get SQLAlchemy and Twisted<br>
> 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't play nice with orms)<br>
<div><br>
> definitive answer. The most promising one I’ve run across concerns<br>
> running the SQLAlchemy queries in a separate process (rather than a<br>
> separate thread) and communicating the queries between the Twisted<br>
> 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 "sqlachemy application" be run?<br>
<div><br>
> 1) Would the SQLAlchemy process also be a Twisted application with<br>
> all the queries running as deferreds in the main thread, and blocking?<br>
<br>
</div>What do you men by "all the queries"?<br>
<div><br>
> Thanks in advance for any help!<br>
<br>
</div>In my case, since most of the app I'm working on is "web requested"<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'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></div></div><font color="#888888"><br><br clear="all"><br>-- <br><a href="http://celord.blogspot.com/" target="_blank">http://celord.blogspot.com/</a><br>
</font><br>_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">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>
<br></blockquote></div><br><div style="visibility: hidden; display: inline;" id="avg_ls_inline_popup"></div><style type="text/css">#avg_ls_inline_popup { position:absolute; z-index:9999; padding: 0px 0px; margin-left: 0px; margin-top: 0px; width: 240px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 13px;}</style>