[Twisted-Python] How to wait for a transport to write some data before loosing the connection

2011-06-28 Thread emmanuel CAZENAVE
Hi, I wrote a server using a protocol that inherit from 'basic.LineReceiver'. In some circonstances I need to reject the data send by the client and to close the connection. Here is how I do that: class MyProtocol(basic.LineReceiver): def error(self, error_msg): self.

Re: [Twisted-Python] How to wait for a transport to write some data before loosing the connection

2011-06-28 Thread Laurens Van Houtven
That's strange. Although the write doesn't block, ITransport.loseConnection() will *first* finish writing everything and *then* lose the connection. cheers lvh ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi

[Twisted-Python] How to safely stop a chain of deferreds

2011-06-28 Thread tomw
Hi, in a GUI application I'm using quite a comprehensive chain of deferreds and I'm running the mainloop from the glib2reactor. At a certain point of my application I need to terminate the entire chain of deferreds to make sure that no more data is loaded and processed. Stopping the react

Re: [Twisted-Python] How to safely stop a chain of deferreds

2011-06-28 Thread Itamar Turner-Trauring
On Tue, 2011-06-28 at 15:30 +0200, tomw wrote: > I tried to > cancel the first deferred, hoping that the cancel event will be > forwarded to the next deferred in the chain or at least invoke an > errback, but for some reason it does not work and the deferreds seem to > run forever. Any ideas on ho

Re: [Twisted-Python] How to safely stop a chain of deferreds

2011-06-28 Thread Terry Jones
Hi Tom > in a GUI application I'm using quite a comprehensive chain of deferreds > and I'm running the mainloop from the glib2reactor. At a certain point of > my application I need to terminate the entire chain of deferreds to make > sure that no more data is loaded and processed. Stopping the rea

Re: [Twisted-Python] jQuery.Deferred - why did they have to go and change the interface?

2011-06-28 Thread Tristan Seligmann
On Mon, Jun 27, 2011 at 11:53 PM, Richard Wall wrote: > I'm in the process of switching some of my Javascript code from > MochiKit.Async.Deferred to the recently introduced jQuery.Deferred. > > Does anyone else hate the confusing new method names they've chosen? > Why couldn't they just stick with

Re: [Twisted-Python] How to safely stop a chain of deferreds

2011-06-28 Thread exarkun
On 01:30 pm, t...@ubilix.com wrote: >Hi, > >in a GUI application I'm using quite a comprehensive chain of deferreds >and I'm running the mainloop from the glib2reactor. At a certain point >of my application I need to terminate the entire chain of deferreds to >make sure that no more data is loaded

Re: [Twisted-Python] How to safely stop a chain of deferreds

2011-06-28 Thread Orestis Markou
On 28 Jun 2011, at 20:37, exar...@twistedmatrix.com wrote: > On 01:30 pm, t...@ubilix.com wrote: >> Hi, >> >> in a GUI application I'm using quite a comprehensive chain of deferreds >> and I'm running the mainloop from the glib2reactor. At a certain point >> of my application I need to terminate