Re: [Twisted-Python] inlineCallbacks: multiple yielding same Defferred behaviour

2013-01-28 Thread exarkun
eld) many times (why not?). > > > > > >I have deal with Task-based programming and async functions (mechanism >similar to Deferred and inlineCallbacks decorated functions in Twisted) >in >Microsoft .NET. > >MS people have implemented Task (analogue of Deferred) i

Re: [Twisted-Python] inlineCallbacks: multiple yielding same Defferred behaviour

2013-01-28 Thread Sergey V. Gerasimov
:43 PM To: ser...@gmail.com Subject: Re: [Twisted-Python] inlineCallbacks: multiple yielding same Defferred behaviour The short answer is that those models don't support chaining the way Deferreds do, IIUC. I think a very similar thing was a bonus question at the tutorial Stephen Thorne

Re: [Twisted-Python] inlineCallbacks: multiple yielding same Defferred behaviour

2013-01-28 Thread Sergey V. Gerasimov
T. MS people have implemented Task (analogue of Deferred) in the way I described. From: Laurens Van Houtven [mailto:_...@lvh.cc] Sent: Monday, January 28, 2013 12:47 PM To: ser...@gmail.com; Twisted general discussion Subject: Re: [Twisted-Python] inlineCallbacks: multiple yielding same Deffer

Re: [Twisted-Python] inlineCallbacks: multiple yielding same Defferred behaviour

2013-01-28 Thread Laurens Van Houtven
I'm not entirely sure why you feel this is unintuitive or why you should need a workaround; in any other case, deferreds work pretty much the same way. When reading this code, the first question that pops up in my head is: why are you doing this instead of just using the result that you already ha

[Twisted-Python] inlineCallbacks: multiple yielding same Defferred behaviour

2013-01-27 Thread Sergey V. Gerasimov
It's not intuitively clear why multiple yielding the same Defferred in function decorated with defer.inlineCallbacks get different results: @defer.inlineCallbacks def f(): d = defer.succeed(1) result = yield d print result result = yield d p