[Twisted-Python] How to detect when there is nothing waiting in the event queue

2009-09-14 Thread Mark Visser
ker Root. How can I detect when all remaining Deferreds have fired so I can stop the reactor safely, without stranding any running processes? thanks -- Mark Visser, Software Director Lumière VFX Email: ma...@lumierevfx.com Phone: +1-514-316-1080 x3030 __

Re: [Twisted-Python] run queries in deffered, but not in transaction

2009-09-15 Thread Mark Visser
eInteractions(db) d = db.runInteraction(one).addBoth(db.runInteraction, two).addBoth(db.runInteraction, three) addBoth is a convenience method that adds the same function as a callback and an errback: http://twistedmatrix.com/documents/8.2.0/api/twisted.internet.defer.Deferred.html#addBo

Re: [Twisted-Python] run queries in deffered, but not in transaction

2009-09-17 Thread Mark Visser
Matt Perry wrote: > would swallow any exceptions thrown by deferred1 and continue on to > create deferred2. If you did: > > d.addCallback(foo) > d.addCallback(bar) > d.addCallback(baz) > > then an exception in "foo" would break the whole callback chain. You can also use addBoth(), which adds a ca

Re: [Twisted-Python] Seeking advice on use of Perspective Broker

2009-09-18 Thread Mark Visser
ommend learning PB first because it has the most examples and docs so > it's the easiest to learn. If you end up using one of the others to get > better security or portability or whatever, it'll be pretty easy to > learn because the Twisted fundamentals carry over.) > >

[Twisted-Python] Trial: Blocking until all deferreds have fired in test

2009-09-25 Thread Mark Visser
ound this by passing a test_mode parameter to TestFoo.__init__ and "yield"-ing doSomethingThatReturnsADeferred(), but I'd rather not introduce special cases for testing. Is there a way to instruct Trial to "wait" for Deferreds to fire? thanks -- Mark Visser, Software Directo

Re: [Twisted-Python] Twisted and db table changes

2009-09-29 Thread Mark Visser
sted and monitor for any changes in a table or can I create > a callback method to be triggered when a change occurs to table. > Check out twisted.internet.task.LoopingCall. It will run a callback periodically, during which you can poll for changes. -- Mark Visser, Software Director Lumière V

[Twisted-Python] Phasing out old-style classes

2009-10-08 Thread Mark Visser
Is there a project underway to modernize twisted? I've been bitten a couple times by twisted's use of old-style classes. Now that Jython is finally off the 2.2 branch, is there any real reason to stay backwards compatible? cheers, -Mark -- Mark Visser, Software Director Lumière VFX

Re: [Twisted-Python] Phasing out old-style classes

2009-10-08 Thread Mark Visser
> For Python 3.x, oldstyle classes don't exist, so that'll happen > automatically during the conversion. > Aha! Let me rephrase that, then: Is there a project underway to port Twisted to Python 3.x? cheers, -Mark -- Mark Visser, Software Director Lumière VFX Email: m