Re: [Twisted-Python] how to write a safe catch-all

2010-09-28 Thread exarkun
On 01:48 pm, ch...@simplistix.co.uk wrote: >Hi All, > >The attached .py file demonstrates a problem I'm having with a little >scheduler I need to maintain. > >The loop() function is supposed to be a "catch all and report" error >handler. However, when the async code initiated by doStuff throws th

[Twisted-Python] how to write a safe catch-all

2010-09-28 Thread Chris Withers
Hi All, The attached .py file demonstrates a problem I'm having with a little scheduler I need to maintain. The loop() function is supposed to be a "catch all and report" error handler. However, when the async code initiated by doStuff throws the AttributeError, what actually gets logged is:

Re: [Twisted-Python] getProcessOutput - Can it be made to return 'output' instead of differed

2010-09-28 Thread Senthil Kumaran
On Tue, Sep 28, 2010 at 12:51:22PM -, exar...@twistedmatrix.com wrote: > > If you're removing the code that blocks, then you should be able to stop > using deferToThread. Then you just have to call getProcessOutput to get > your `d` above (or another function that calls it and perhaps adds

Re: [Twisted-Python] getProcessOutput - Can it be made to return 'output' instead of differed

2010-09-28 Thread exarkun
On 10:16 am, orsent...@gmail.com wrote: >Hello, > >My current application structure is like this: > >If something: > d = defertoThread(func1,params1) >if something2: > d = defertoThread(func2, params2) >... > > >d.addCallback(lambda r: transport.write(r) > >I had designed it this way because, t

[Twisted-Python] getProcessOutput - Can it be made to return 'output' instead of differed

2010-09-28 Thread Senthil Kumaran
Hello, My current application structure is like this: If something: d = defertoThread(func1,params1) if something2: d = defertoThread(func2, params2) ... d.addCallback(lambda r: transport.write(r) I had designed it this way because, the functions, func1, func2 etc.. were all assumed to b