Re: [Twisted-Python] Deferred documentation rewrite

2009-08-05 Thread Glyph Lefkowitz
On Mon, Aug 3, 2009 at 6:00 PM, Edward Z. Yang wrote: > I have updated my draft here: > >http://ezyang.com/twisted/defer2.html > Thanks. Looks like it's improving. I've got more points to critique now, but that's only because there's more meat to the tutorial now :). 1. The coding stan

Re: [Twisted-Python] Adbapi issues

2009-08-05 Thread Dave Peticolas
Gerrat Rickert wrote: > I'd like to use twisted's adbapi module (twisted 8.2.0 for python 2.5) > with cx_Oracle, but I'm having some issues with it. > Specifically: > > 1. It doesn't seem to reconnect (or possibly I just need enlightenment > on how reconnecting works): > If I tweak part of the

Re: [Twisted-Python] Really Basic clarification on defers

2009-08-05 Thread Jarrod Roberson
On Wed, Aug 5, 2009 at 6:04 PM, John Aherne wrote: > > > 2. If you have blocking code - *please define blocking* :), then first > think about putting it into deferToThread with appropriate callbacks and > return the deferred. As suggested by Jarrod in his response. > > > blocking code is code th

[Twisted-Python] Adbapi issues

2009-08-05 Thread Gerrat Rickert
I'd like to use twisted's adbapi module (twisted 8.2.0 for python 2.5) with cx_Oracle, but I'm having some issues with it. Specifically: 1. It doesn't seem to reconnect (or possibly I just need enlightenment on how reconnecting works): If I tweak part of the test_adbapi.py script to work for Or

Re: [Twisted-Python] Really Basic clarification on defers

2009-08-05 Thread John Aherne
On Wed, Aug 5, 2009 at 4:17 PM, wrote: > On 09:33 am, johnahe...@rocs.co.uk wrote: > >On Wed, Aug 5, 2009 at 12:14 AM, Johann Borck > >wrote: > >> > >[snip] > > > >Sendline is not blocking so as you say we can avoid the use of > >deferreds and > >continue to use sendline directly. > > LineReceive

Re: [Twisted-Python] How to debug an AMP connection?

2009-08-05 Thread Peter Westlake
Background: I have a client program that calls callRemote, but the Deferred that callRemote returns is not fired. This is an intermittent error that only happens after some hours of traffic. By putting some logging into AMP, it's apparent that the server gets as far as sending the reply using BoxD

Re: [Twisted-Python] Really Basic clarification on defers

2009-08-05 Thread exarkun
On 09:33 am, johnahe...@rocs.co.uk wrote: >On Wed, Aug 5, 2009 at 12:14 AM, Johann Borck >wrote: >> >[snip] > >Sendline is not blocking so as you say we can avoid the use of >deferreds and >continue to use sendline directly. LineReceiver.sendLine is not blocking, correct. However, your statemen

Re: [Twisted-Python] Really Basic clarification on defers

2009-08-05 Thread John Aherne
On Wed, Aug 5, 2009 at 1:11 AM, Aaron Bush wrote: > A note on how I handled a similar situation in regards to the timeout > requirements you seem to have: > > I had a similar setup where I was forwarding data from clients to servers > and back and forth, etc. I wanted to timeout the connection a

Re: [Twisted-Python] Really Basic clarification on defers

2009-08-05 Thread John Aherne
On Wed, Aug 5, 2009 at 12:14 AM, Johann Borck wrote: > > On Tue, Aug 4, 2009 at 10:08 AM, John Aherne > wrote: > > This is a really basic problem we are trying to decide about, > > > > We have programs that run quite happily, so far. Its main task is to > > receive d

Re: [Twisted-Python] Really Basic clarification on defers

2009-08-05 Thread John Aherne
Thanks for the reminder about deferreds. I think the problem is more to do with knowing what role the reactor and select perform. I assume that sending and receiving data with sendline and linereceived are not blocking. So for our simple case we can ignore deferreds. They provide no benefit. Thi