Re: [Twisted-Python] inlineCallbacksDecorator

Hi Maarten
Yes, that's right, and it could be used in that case if you didn't want to deal with the deferred you were about to return inside your method. I wrote it specifically for inlineCallbacks because that case is a bit different. With inlineCallbacks, the called method never has its hands on the deferred that the caller will receive (whereas in a typical deferred-returning method you either create the deferred yourself or call something that does). In fact, the deferred the caller receives will normally be returned back to the caller before the called method has finished. Also, a return out of an inlineCallbacks function may happen at many places (due to the hidden _DefGen_Return raise done by defer.returnValue), so it's not as simple to arrange to do things at the end of the method as it is in other circumstances. Terry
participants (1)
-
Terry Jones