[pypy-dev] Would the following shared memory model be possible?

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Thu Jul 29 23:24:58 CEST 2010


On 08:39 pm, andrewfr_ice at yahoo.com wrote:
>
>Okay. I attended Ray's Hettinger's talk on Monocle. In the past
>I have encountered situations where I bumped up with the nesting 
>problem.
>If I recall, the problem involved request handlers that had a RPC style 
>AND made additional Twisted deferred calls:
>
>class MyRequestHandler(...):
>
>    @defer.inlineCallbacks
>    def process(self):
>        try:
>            result = yield
>client.getPage("http://www.google.com")
>        except Exception, err:
>            log.err(err, "process getPage call
>failed")
>        else:
>            # do some processing with the result
>            return result
>
>looks reasonable but Python will balk.

Aside from the "return result" (should be defer.returnValue(result), 
generators can't return with a value), this looks fine to me too.  Why 
do you say Python will balk?

Jean-Paul



More information about the Pypy-dev mailing list