InlineCallback Friendly ? Re: [Twisted-Python] Question
Andrew Francis
andrewfr_ice at yahoo.com
Thu Feb 21 15:00:07 MST 2008
Hi Jean-Paul:
>Depending on the value returned by a method is an API
>decision made by whoever implemented the protocol.
...
>The only kind of dispatcher which is really hostile
>towards inlineCallbacks is the kind which is hostile
>towards Deferreds in general - ie, one which requires
>a return value and does not support Deferreds.
This is extremely *helpful*. From reading the
"Evolution of Finger" paper, I am realising that
Deferreds are also used in ServerProtocols (this makes
sense).
>Not really. It's just an API. Unless the return
>value isn't allowed to be a Deferred, there's little
>difference between using the return
>value and ignoring it.
...
>The reactor doesn't care. This is all pyAMF stuff.
>pyAMF accepts Deferreds (again, near as I can tell)
>and treats their eventual result as the response to
>the request, sending it off in whatever
>way is appropriate for AMF.
I notice that I am using an old version of pyAMF. When
I tried callbacks, a string representation of the
Deferred was sent back to my client. Looking at the
latest version (I can't install and use it right now),
I see lines like "A Twisted Friendly implement"
version and __call__ returns a deferred.
Once again Jean-Paul, I find your explanation super
helpful and save me time going down the wrong path.
Cheers,
Andrew
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
More information about the Twisted-Python
mailing list