Re: [Twisted-Python] inlineCallbacks cascading cancelling and more

2010-08-24 Thread Sergey Magafurov
> If you can write some unit tests for this, turn the whole thing into a > patch (using svn diff), and attach it to ticket #4632, that'd be great. > > Jean-Paul > done! ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedm

Re: [Twisted-Python] inlineCallbacks cascading cancelling and more

2010-08-23 Thread exarkun
On 10:22 am, smagafu...@naumen.ru wrote: >Thanks to all! >Especially to Yaroslav Fedevych who explain me my misstake in my native >language :) >I was wrong with deferreds usage. > >Cascading cancelling of inlineCallbacks is still needed to me, but it >can be realized with current Deferred API. >

Re: [Twisted-Python] inlineCallbacks cascading cancelling and more

2010-08-23 Thread Sergey Magafurov
Thanks to all! Especially to Yaroslav Fedevych who explain me my misstake in my native language :) I was wrong with deferreds usage. Cascading cancelling of inlineCallbacks is still needed to me, but it can be realized with current Deferred API. This way for example: class InlineCallbacksMa

Re: [Twisted-Python] inlineCallbacks cascading cancelling and more

2010-08-21 Thread Glyph Lefkowitz
On Aug 17, 2010, at 12:46 AM, Yaroslav Fedevych wrote: > > On Aug 17, 2010, at 8:49 AM, Sergey Magafurov wrote: > >> ... lots of text skipped ... > > You are currently considering your task from the viewpoint “let's make a > callback chain for the perfect workflow and alter this chain in case

Re: [Twisted-Python] inlineCallbacks cascading cancelling and more

2010-08-17 Thread Sergey Magafurov
You are currently considering your task from the viewpoint “let's make a callback chain for the perfect workflow and alter this chain in case of anything going wrong.” I think the flaw with this approach is that you are trying to make your “ideal” flow work at all in situations where it would

Re: [Twisted-Python] inlineCallbacks cascading cancelling and more

2010-08-17 Thread Yaroslav Fedevych
On Aug 17, 2010, at 8:49 AM, Sergey Magafurov wrote: > ... lots of text skipped ... You are currently considering your task from the viewpoint “let's make a callback chain for the perfect workflow and alter this chain in case of anything going wrong.” I think the flaw with this approach is tha

Re: [Twisted-Python] inlineCallbacks cascading cancelling and more

2010-08-16 Thread Sergey Magafurov
Some mistake fixes in my previous message > @inlineCallbacks > def acquire_tts_for(self, call): > tts_connection = yield self.tts.acquire_connection(timeout=10) # > may raise TimeoutError inside > yield call.make_audio_link_with(tts_connection, 'in', timeout=10) > # may raise TimeoutError

Re: [Twisted-Python] inlineCallbacks cascading cancelling and more

2010-08-16 Thread Sergey Magafurov
First, generally: the most important thing to provide here are unit tests with very clear documentation expressing why you would want these things to work. The test code you provided is unclear because it does not succeed or fail, it just does some things, and then does some other things, wi

Re: [Twisted-Python] inlineCallbacks cascading cancelling and more

2010-08-16 Thread Glyph Lefkowitz
On Aug 16, 2010, at 1:34 AM, Sergey Magafurov wrote: > At first, sorry for my bad english No problem, Sergey. I am sure that my Russian would be worse. Ivan's response already covered a lot of the things I would say, but I did want to add a few things. First, generally: the most important thi

Re: [Twisted-Python] inlineCallbacks cascading cancelling and more

2010-08-16 Thread Ivan Kozik
On Mon, Aug 16, 2010 at 08:34, Sergey Magafurov wrote: > Wanted features: > 1. Ability to delete callbacks (delCallbacks) > 2. Automatic cancelling Deferreds if they are not needed any more (no > callbacks registered any more, all was deleted) > 3. Ability to add/del hooks on deferred's finishing

[Twisted-Python] inlineCallbacks cascading cancelling and more

2010-08-16 Thread Sergey Magafurov
At first, sorry for my bad english I will try to explain idea about Deferreds and inlineCallbacks Wanted features: 1. Ability to delete callbacks (delCallbacks) 2. Automatic cancelling Deferreds if they are not needed any more (no callbacks registered any more, all was deleted) 3. Ability to add/