Re: [Twisted-Python] deferred graph?

2012-07-18 Thread Tom Prince
Dan Stromberg writes: > Strangely, this doesn't give the report until after the sleep finishes... That is because the code you included doesn't actually print the returned traceback. The reason that it gets printed at the end is because it gets garbage collected then. The following code prints o

Re: [Twisted-Python] Effects of backlog parameter on listenTCP

2012-07-18 Thread Tim Allen
On Wed, Jul 18, 2012 at 04:43:01PM -0700, Tobias Oberstein wrote: > Could someone shortly elaborate on the semantics / effect of the parameter > "backlog" with listenTCP? It exactly corresponds to the "backlog" parameter of the BSD socket API function "listen(int sockfd, int backlog)". On my Debi

Re: [Twisted-Python] Effects of backlog parameter on listenTCP

2012-07-18 Thread Itamar Turner-Trauring
On 07/18/2012 07:43 PM, Tobias Oberstein wrote: > Could someone shortly elaborate on the semantics / effect of the parameter > "backlog" with listenTCP? > > The docs say: "size of the listen queue". > > Is that a tunable within Twisted? > > I mean, there are kernel parameters for queue sizes of no

Re: [Twisted-Python] deferred graph?

2012-07-18 Thread Andrew Bennetts
Dan Stromberg wrote: > On Wed, Jul 18, 2012 at 3:32 AM, wrote: > > > > I don't think anything in the thread suggested that this approach will > > circumvent a time.sleep(10) call. > > I'm not sure where you're getting this circumvention issue from. At this point I'm not sure what the problem you

[Twisted-Python] Effects of backlog parameter on listenTCP

2012-07-18 Thread Tobias Oberstein
Could someone shortly elaborate on the semantics / effect of the parameter "backlog" with listenTCP? The docs say: "size of the listen queue". Is that a tunable within Twisted? I mean, there are kernel parameters for queue sizes of not yet completely TCP handshaked connections and so on. But t

Re: [Twisted-Python] deferred graph?

2012-07-18 Thread Dan Stromberg
On Wed, Jul 18, 2012 at 3:32 AM, wrote: > > > I don't think anything in the thread suggested that this approach will > circumvent a time.sleep(10) call. I'm not sure where you're getting this circumvention issue from. > In any case, it won't. Why is there > a time.sleep(10) call there at all

Re: [Twisted-Python] unit testing question: twisted with tk

2012-07-18 Thread Russell E. Owen
In article <5006fc68.8050...@itamarst.org>, Itamar Turner-Trauring wrote: > On 07/18/2012 01:01 PM, Russell E. Owen wrote: > > I have a bit of code that combines twisted with Tkinter > > and now I'd like to write some unittests for it. > > > > I can't seem to figure out how to get TwistedTrial t

Re: [Twisted-Python] A few simple questions

2012-07-18 Thread Itamar Turner-Trauring
On 07/18/2012 01:31 PM, Russell E. Owen wrote: > If there is a "best practices for error handling" document I'd love to > read it. I found an overview of deferreds that was helpful. It pointed > out that addCallbacks is not the same as addCallback followed by > addErrback and I'm not sure I'm handl

Re: [Twisted-Python] unit testing question: twisted with tk

2012-07-18 Thread Itamar Turner-Trauring
On 07/18/2012 01:01 PM, Russell E. Owen wrote: > I have a bit of code that combines twisted with Tkinter > and now I'd like to write some unittests for it. > > I can't seem to figure out how to get TwistedTrial to handle this case. > I've written a unit test like this: > > from twisted.trial import

Re: [Twisted-Python] A few simple questions

2012-07-18 Thread Naveen Michaud-Agrawal
If you haven't seen it already, Dave Peticolas has a great introduction to twisted (it's a bit long, but well worth it) at http://krondo.com/?page_id=1327. In particular, until I saw this graphic on callback/errback chaining ( http://krondo.com/blog/wp-content/uploads/2009/10/deferred-2.png), I nev

Re: [Twisted-Python] unit testing question: twisted with tk

2012-07-18 Thread Phil Mayers
On 07/18/2012 06:01 PM, Russell E. Owen wrote: > root = Tkinter.Tk() > twisted.internet.tksupport.install(root) Does the TK support work like other reactors i.e. it must be the very first thing in the python file, before all other Twisted imports? ___

Re: [Twisted-Python] A few simple questions

2012-07-18 Thread Russell E. Owen
In article , Glyph wrote: > On Jul 17, 2012, at 9:25 AM, Russell E. Owen wrote: > > >> Can you elaborate on the case? > > > > I've found that Twisted sometimes swallows errors unless I am extremely > > careful. I would like to be able to check a protocol to make sure it is > > operational (

[Twisted-Python] unit testing question: twisted with tk

2012-07-18 Thread Russell E. Owen
I have a bit of code that combines twisted with Tkinter and now I'd like to write some unittests for it. I can't seem to figure out how to get TwistedTrial to handle this case. I've written a unit test like this: from twisted.trial import unittest from twisted.internet.defer import Deferred impo

Re: [Twisted-Python] deferred graph?

2012-07-18 Thread exarkun
On 02:24 am, drsali...@gmail.com wrote: >On Tue, Jul 17, 2012 at 12:53 PM, wrote: >>On 03:40 pm, drsali...@gmail.com wrote: >> >> >> >>Strangely, this doesn't give the report until after the sleep >> >>finishes... ? >> >>What's strange about that? "time.sleep(10)" doesn't mean "immediately >>pr