Re: [Twisted-Python] understanding deferreds

2010-02-02 Thread Andrew Bennetts
Landreville wrote: > On Sat, Jan 30, 2010 at 2:16 AM, Andrew Bennetts > wrote: > > twisted-...@udmvt.ru wrote: > > [...] > >> Is it true, that adding many callback functions as filters is elegant, > >> but impractical solution? > >> Since there is only a [linear] list of pairs (callback, errback)

Re: [Twisted-Python] understanding deferreds

2010-02-01 Thread Terry Jones
> "Alexey" == twisted-web writes: Alexey> Is it true, that adding many callback functions as filters is Alexey> elegant, but impractical solution? Many callbacks as a filter is elegant & practical. But there's a difference with errbacks, as people are touching on. That's, with a bit of han

Re: [Twisted-Python] understanding deferreds

2010-02-01 Thread Landreville
On Sat, Jan 30, 2010 at 2:16 AM, Andrew Bennetts wrote: > twisted-...@udmvt.ru wrote: > [...] >> Is it true, that adding many callback functions as filters is elegant, >> but impractical solution? >> Since there is only a [linear] list of pairs (callback, errback), the last >> errbacks >> have to

Re: [Twisted-Python] understanding deferreds

2010-01-29 Thread Andrew Bennetts
twisted-...@udmvt.ru wrote: [...] > Is it true, that adding many callback functions as filters is elegant, > but impractical solution? > Since there is only a [linear] list of pairs (callback, errback), the last > errbacks > have to be complex to distinguish the failures, that came from the previo

Re: [Twisted-Python] understanding deferreds

2010-01-29 Thread twisted-web
On Thu, Jan 28, 2010 at 05:46:08PM -0500, Terry Jones wrote: > > "Michael" == Michael P Soulier writes: > > Michael> I'm a bit confused as to the "visual explanation". It seems like > Michael> if you have a single callback and errback, that if the errback > Michael> wants to swallow the error

Re: [Twisted-Python] understanding deferreds

2010-01-28 Thread Michael P. Soulier
On 29/01/10 Tristan Seligmann said: > Just to expand on exarkun's answer a little, it might help to > understand that addCallback and addErrback are simply implemented in > terms of addCallbacks. Roughly: > > def passthru(arg): > return arg > > d.addCallback(cb) is equivalent to d.addCallbac

Re: [Twisted-Python] understanding deferreds

2010-01-28 Thread Tristan Seligmann
On Fri, Jan 29, 2010 at 12:39 AM, wrote: > There are at least three ways you can have a single callback and > errback: > >   d.addCallback(cb) >   d.addErrback(eb) > > or > >   d.addErrback(eb) >   d.addCallback(cb) Just to expand on exarkun's answer a little, it might help to understand that ad

Re: [Twisted-Python] understanding deferreds

2010-01-28 Thread Terry Jones
> "Michael" == Michael P Soulier writes: Michael> I'm a bit confused as to the "visual explanation". It seems like Michael> if you have a single callback and errback, that if the errback Michael> wants to swallow the error, the callback will not be called at Michael> all, since deferred proce

Re: [Twisted-Python] understanding deferreds

2010-01-28 Thread exarkun
On 10:28 pm, msoul...@digitaltorque.ca wrote: >Hello, > >I've been reading up on this > >http://twistedmatrix.com/documents/current/core/howto/defer.html > >I'm a bit confused as to the "visual explanation". It seems like if you >have a >single callback and errback, that if the errback wants to sw