Ok, got a little further...

From the docs:

...If additional arguments are given, then func will be replaced with MochiKit.Base.partial.apply(null, arguments). This differs from Twisted, because the result of the callback will be the last argument passed to func...

So my extra args are passed into the callback first:

d.addCallback(
function (msg,req) {
logDebug(msg);
},
'Hello');

Now debugs 'Hello'. But req is 'undefined'. So now I can't get at my request. :-(

Juergen


On Sep 19, 2006, at 8:19 AM, Juergen Schreck wrote:


Bob -

Interesting. I didn't see that option. I think it's obvious that my  
non-existent knowledge of Phython and Twisted are showing. I followed  
the links to Twisted in the doco to educate myself with the sole  
result of a massive headache. :-)

Clearly I'm still not quite getting it:

d.addCallback(
function (req,msg) {
logDebug(msg);
},
'Hello');

msg comes up empty in the callback. So how do I get the passed  
parameter?

Thanks,
Juergen


On Sep 18, 2006, at 11:49 PM, Bob Ippolito wrote:

On 9/18/06, Juergen Schreck <[EMAIL PROTECTED]> wrote:

Deferred passes the XHR object to it's callback function. Is there a
way to get a reference to the Deferred in the callback?


No, and you don't want to do that either.

If you want additional stuff to be passed to the callback, pass it
when you add the callback. It's documented:
deferred.prototype.addcallback

-bob




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---

Reply via email to