Re: [Twisted-Python] synchronous/asynchronous api: possible interface

2009-11-13 Thread exarkun
On 04:03 pm, doug.farr...@gmail.com wrote: >Jean-Paul, > >Thanks for the "heads up", that certainly falls under the D'OH! >category. Would you have any suggestions for how I might do this kind >of thing? I already mentioned SynchronousDeferred, so I guess you're not interested in that. :) The

Re: [Twisted-Python] synchronous/asynchronous api: possible interface

2009-11-13 Thread Tom Leys
Hi Doug. I think that a decorator is a fairly nice idea, however you will probably run into the following issue: http://twistedmatrix.com/trac/ticket/2066 Once a reactor has been started and stopped, starting the reactor again will crash your program. You will need to come up with a way to get

Re: [Twisted-Python] synchronous/asynchronous api: possible interface

2009-11-13 Thread exarkun
On 02:32 pm, doug.farr...@gmail.com wrote: >Hi all, > >I'd like to get some comments on the code below (including, "don't be >a bonehead!" ). I'm trying to write a API library for database >access that can be used by both synchronous (non-twisted, no reactor) >code and asynchronous (twisted, with r