Re: [Twisted-Python] SQLAlchemy and Twisted

2010-05-09 Thread Glyph Lefkowitz
On May 9, 2010, at 4:14 PM, Konrads Smelkovs wrote: > I think that nice syntax contributes towards adoption. Not as much as consistency and coherency. > Subclassing deferred and adding a __get__ function that queues calls for > future > Deferreds is at least worth a shot. Nope. If you want to

Re: [Twisted-Python] SQLAlchemy and Twisted

2010-05-09 Thread Konrads Smelkovs
I think that nice syntax contributes towards adoption. Subclassing deferred and adding a __get__ function that queues calls for future Deferreds is at least worth a shot. Perhaps adding a safety net with allowed function names would help. This list could be per "project" - storm orm integration wou

Re: [Twisted-Python] SQLAlchemy and Twisted

2010-05-09 Thread Daniel Griffin
That is kind of what I found. In my app I basically have the following triggered using callLater: do a select and create a new SSL connection for each item returned Wait for the response Do between 2 and 4 inserts depending on results Close the connection. As measured in connections completed pe

Re: [Twisted-Python] SQLAlchemy and Twisted

2010-05-09 Thread Phil Mayers
On 05/09/2010 07:07 AM, Daniel Griffin wrote: > If you let SQLAlchemy block twisted would there be any impact besides > performance? Depends how long it blocks for, and what else your process is doing. With the reactor blocked: * no socket reads or accepts can be done * no callLater or Loopi

Re: [Twisted-Python] SQLAlchemy and Twisted

2010-05-08 Thread Daniel Griffin
If you let SQLAlchemy block twisted would there be any impact besides performance? Dan On Fri, May 7, 2010 at 1:35 PM, wrote: > On 03:37 pm, > drwxrwxr.x+twistedm...@gmail.comwrote: > >>(yield resultset[10:20]).sort(Sort.ASC) > >> > >>assuming a new enough version of Python. > > > >I wonder if

Re: [Twisted-Python] SQLAlchemy and Twisted

2010-05-07 Thread exarkun
On 03:37 pm, drwxrwxr.x+twistedm...@gmail.com wrote: >>(yield resultset[10:20]).sort(Sort.ASC) >> >>assuming a new enough version of Python. > >I wonder if it a good idea to subclass Deferred and define __call__() >for it, making it attach callbacks to itself. >Theoretically should work in earlier

Re: [Twisted-Python] SQLAlchemy and Twisted

2010-05-07 Thread exarkun
On 01:34 pm, mithra...@mithrandi.net wrote: On Fri, May 7, 2010 at 12:53 PM, Konrads Smelkovs wrote: If you want an ORM in Twisted look for STORM twisted integration. Overall, it works (I tried). Some quirks are there, e.g. without twisted you would do something like resultset[10:20].sort(Sort

Re: [Twisted-Python] SQLAlchemy and Twisted

2010-05-07 Thread Jaroslaw Fedewicz
> (yield resultset[10:20]).sort(Sort.ASC) > > assuming a new enough version of Python. I wonder if it a good idea to subclass Deferred and define __call__() for it, making it attach callbacks to itself. Theoretically should work in earlier versions and make the syntax look more transparent. _

Re: [Twisted-Python] SQLAlchemy and Twisted

2010-05-07 Thread Tristan Seligmann
On Fri, May 7, 2010 at 12:53 PM, Konrads Smelkovs wrote: > If you want an ORM in Twisted look for STORM twisted integration. Overall, > it works (I tried). Some quirks are there, e.g. without twisted you would do > something like resultset[10:20].sort(Sort.ASC) but with twsited you have to > do (a

Re: [Twisted-Python] SQLAlchemy and Twisted

2010-05-07 Thread Konrads Smelkovs
If you want an ORM in Twisted look for STORM twisted integration. Overall, it works (I tried). Some quirks are there, e.g. without twisted you would do something like resultset[10:20].sort(Sort.ASC) but with twsited you have to do (assuming inlineCallbacks) res= yield resultset[10:20] res = yield

Re: [Twisted-Python] SQLAlchemy and Twisted

2010-05-06 Thread Kevin Horn
You might also check out sAsync: http://sasync.org/ This was a project apparently abandoned (?) by the original author, but it's recently been picked up by someone else. Kevin Horn On Thu, May 6, 2010 at 2:04 PM, César García wrote: > Guys, now that I see this and the past conversations about

Re: [Twisted-Python] SQLAlchemy and Twisted

2010-05-06 Thread César García
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 I am doing this: 1. Twisted IMAP4 Client to read my mails 2. Inside this client I import a module that con

Re: [Twisted-Python] SQLAlchemy and Twisted

2010-05-05 Thread Chris Withers
Doug Farrell wrote: > > I’ve been doing some searching about how to get SQLAlchemy and Twisted > working together in a Twisted application. Short version: to be safe, anything that touches any SQLAlchemy-mapped object needs to be run in its own thread. Any query or access of an attribute of a

Re: [Twisted-Python] SQLAlchemy and Twisted

2010-05-05 Thread Don Dwiggins
Doug Farrell wrote: > I’ve been doing some searching about how to get SQLAlchemy and Twisted > working together in a Twisted application. Though I’ve found a lot of > information, I haven’t seen (or figured out) a good working solution or > definitive answer. The most promising one I’ve run acro

[Twisted-Python] SQLAlchemy and Twisted

2010-05-05 Thread Doug Farrell
Hi all, I've been doing some searching about how to get SQLAlchemy and Twisted working together in a Twisted application. Though I've found a lot of information, I haven't seen (or figured out) a good working solution or definitive answer. The most promising one I've run across concerns running

Re: [Twisted-Python] SQLAlchemy and Twisted

2009-02-13 Thread Peter Cai
Hi, Thanks for this insightful comments on Sqlalchmy and Twisted. I hope I had read your mail before I start my current project. At that time, I simply thought using deferToThread would solve everything since the twisted.enterprise.adbapi simply use threads.deferToThreadPool to make database in