Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-25 Thread Allen Short
On Thu, Aug 25, 2011 at 4:29 AM, Tobias Oberstein < tobias.oberst...@tavendo.de> wrote: > I know this is kinda OT for this list, but it could serve Twisted > indirectly: by propagating > it's mature, sane Deferred concept/terminology instead of half-baked, > flawned others. > In some ways the po

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-25 Thread Tobias Oberstein
I have collected the Deferreds from Nevow MochiKit Closure jQuery (and Twisted) here https://github.com/oberstet/jdeferred/tree/master/others for convenient comparison. I'd be interested in baking a JS Deferred which - replicates the Twisted Deferred in semantics and syntax (API) as closely a

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-25 Thread Jonathan Lange
On Thu, Aug 25, 2011 at 10:43 AM, Tobias Oberstein wrote: >>> Note that as far as I know, MochiKit isn't actively developed anymore. >>> Google's Closure has a fork of MochiKit's Deferred's, which seems to >>> incorporate some of Dojo's code as well. >>> >>> >>> http://code.google.com/p/closure-li

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-25 Thread Tobias Oberstein
>> Note that as far as I know, MochiKit isn't actively developed anymore. >> Google's Closure has a fork of MochiKit's Deferred's, which seems to >> incorporate some of Dojo's code as well. >> >> >> http://code.google.com/p/closure-library/source/browse/trunk/third_party/clos >> ure/goog/mochik

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread L. Daniel Burr
Hi Jasper, On Wed, 24 Aug 2011 19:48:14 -0500, Jasper St. Pierre wrote: > Note that as far as I know, MochiKit isn't actively developed anymore. > Google's Closure has a fork of MochiKit's Deferred's, which seems to > incorporate some of Dojo's code as well. > > > http://code.google.com/p/

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Jasper St. Pierre
Note that as far as I know, MochiKit isn't actively developed anymore. Google's Closure has a fork of MochiKit's Deferred's, which seems to incorporate some of Dojo's code as well. http://code.google.com/p/closure-library/source/browse/trunk/third_party/closure/goog/mochikit/async/ On Wed, Aug

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Tobias Oberstein
Jasper, Allen, Richard, thanks all for the pointers. I am confused now;) No, seriously, I need to _test_ those libs, to see what they actually do. I.e. I suspect the "new Dojo Deferreds" with "then" return something different than the broken "then" in jQuery 1.5. This is all messy, personally,

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Richard Wall
On 25 August 2011 00:30, Tobias Oberstein wrote: > I am still wondering why they called the other stuff "then()" when it's not > then, but "also()" > and "pipe()" is the real ;) I agree. I had the same frustration a few months ago and various Twisted people pointed out missing features in Jquer

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Allen Short
My understanding (partially aided by this post: http://www.sitepen.com/blog/2010/05/03/robust-promises-with-dojo-deferred-1-5/) is that Dojo provides both twisted-style "addCallback" and CommonJS-style "then" methods. ___ Twisted-Python mailing list Twist

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Jasper St. Pierre
As far as I know, Dojo's Deferreds are a direct port of Twisted's. On Wed, Aug 24, 2011 at 7:30 PM, Tobias Oberstein wrote: > Found something: it seems in jQuery 1.6 they have introduced something which > corresponds > more closely to Twisted Deferreds callback/errback chains: > > //

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Tobias Oberstein
Found something: it seems in jQuery 1.6 they have introduced something which corresponds more closely to Twisted Deferreds callback/errback chains: // prints 23 sess.call("square", 23).pipe(function(res) { return sess.call("sqrt",

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Tobias Oberstein
Ok. This is most unpleasant. In particular since my options then are: 1) write my own, sane (Twisted like, which I think is the sane way) JS deferred, not use jQuery/CommonJS (which everyone else does) 2) open the door for users running into issues when they do both Twisted & JS/jQuery and don't

Re: [Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Allen Short
No, this is something jQuery and CommonJS got wrong; callbacks don't chain in their implementation. Firing a jQuery promise invokes each callback in order with the same argument. Firing a Deferred in Twisted invokes the first callback then passes its return value as the arg to the next callback, a

[Twisted-Python] Twisted vs jQuery Deferreds (was Re: RPC design questions)

2011-08-24 Thread Tobias Oberstein
I follow Glyphs advice and only keep the lambda version with standard Twisted Deferred. However, I've got a (I believe) more serious "design" problem. The RPC stuff works in Twisted, but also from JavaScript. So I have 2 audiences (Twisted and JS developers). On JS, I use the Deferreds that co