2 ms·
Deferreds are cool although they have their own set of issues. Mainly, that when you start chaining them there are situations where it can be a bit counterintu
by harshaw 14y ago
Deferreds are cool although they have their own set of issues. Mainly, that when you start chaining them there are situations where it can be a bit counterintuitive what is going on. My background is the Deferred from Twisted and Reimplemented in MochiKit.
You really need to read the Deferred implementation if you are going to use it. Otherwise you are asking for trouble long term. Of course, the other issue is that you may run into challenges explaining deferred's to your co-workers. :)
Twisted explored some cool ideas where you basically would write asynchronous code in an interative style using a blend of iterators and generators. Sadly until Javascript has those capabilities in every browser (and not just Firefox) I don't think it is possible.
- jlgreco 14y agoParticularly Twisted's inlineCallbacks (http://twistedmatrix.com/documents/current/api/twisted.internet.defer.html#inlineCallbacks http://twistedmatrix.com/documents/current/api/twisted.inter...) are really nice. They are so nice, they actually completely offset all the other unpleasantness I experiance from Twisted.
- harshaw 14y agoYup thats what I was thinking of.