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

Amaury Forgeot d'Arc amauryfa at gmail.com
Mon Jun 27 18:33:39 EDT 2011


2011/6/28 Glyph Lefkowitz <glyph at twistedmatrix.com>:
> On Jun 27, 2011, at 5:53 PM, Richard Wall wrote:
>
> Does anyone else hate the confusing new method names they've chosen?
>
> Yes.

No! Because it's not a Deferred.

The JQuery Deferred has only a slight resemblance with Twisted's.
Looking at the source code
https://github.com/jquery/jquery/blob/master/src/deferred.js
this implementation lacks many important features of the Deferred we know:

- All callbacks are called with the same "result"
- Impossible to recover from an errback (and call the next callback)
- The callback chain is not paused when a callback returns another Deferred

IOW, don't use it as a Deferred.
The Mochikit implementation looks much more similar to Twisted.

-- 
Amaury Forgeot d'Arc



More information about the Twisted-Python mailing list