[Twisted-Python] how to create state machines?

2009-03-26 Thread Doug Farrell
Hi all, I'm still getting my 'sea legs' with Twisted, so this may be a novice question, but I'm wondering what would be a good way to create a state machine with Twisted? For instance I've written quite a bit of code in different languages that creates co-operative, context switching schemes us

[Twisted-Python] RE: how to create state machines?

2009-03-30 Thread Doug Farrell
reactor. Also you should distinguish > between writing a new protocol and using an existing one. > > In the case of XMLRPC, creating the server isn't the problem. > > http://twistedmatrix.com/projects/web/documentation/howto/xmlrpc.html > > Once a XMLRPC server is created, T

[Twisted-Python] Question about deferreds

2009-05-05 Thread Doug Farrell
Hi all, I consider myself a Twisted "newbie", so this might seem like a simple couple of questions, hope you'll indulge me. When I first began experimenting with deferreds I was breaking up tasks into sequences of steps something like this: d = Deferred() d.succeed(True) d.addCallback

Re: [Twisted-Python] Question about deferreds

2009-05-07 Thread Doug Farrell
Glyph, Thank you very much for your response, it has provided me with material that will help me take a big step in my Twisted education. > > Deferreds are not about breaking your work up into steps to save time. > They're about breaking it up so that different systems can deal with > the

[Twisted-Python] twisted.internet.task.LoopingCall

2009-06-04 Thread Doug Farrell
Hi all, I'm using the twisted.internet.task.LoopingCall system to run periodic tasks in a Twisted server. If I had code like this: from twisted.internet.task import LoopingCall lp = LoopingCall(someFunction) lp.start(5.0) # run every 5 seconds Is there anything in LoopingCall to keep it from

Re: [Twisted-Python] Twisted-Python Digest, Vol 63, Issue 7

2009-06-08 Thread Doug Farrell
sing your > task returns a deferred that takes a long time to fire :-) Try it. > > Terry > [Doug Farrell] Don't mind the PITA at all, I actuall did read the source code and just didn't 'get it' so much. In my case the function that LoopingCall was passed was actua

[Twisted-Python] Twisted synchronous and asynchronous db connections

2009-11-09 Thread Doug Farrell
Hi all, Our projects at work include synchronous applications (short lived) and asynchronous Twisted applications (long lived). We're re-factoring our database and are going to build an API module to decouple all of the SQL in that module. I'd like to create that API so both synchronous and asynch

Re: [Twisted-Python] Twisted synchronous and asynchronous db connections

2009-11-10 Thread Doug Farrell
Jean-Paul, Thanks for the link, I'm looking at it right now. Doug On Mon, Nov 9, 2009 at 10:43 PM, wrote: > On 03:24 am, doug.farr...@gmail.com wrote: >>Hi all, >> >>Our projects at work include synchronous applications (short lived) >>and asynchronous Twisted applications (long lived). We're

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

2009-11-13 Thread Doug Farrell
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 reactor) code where the methods of the library can

[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