Matt Perry wrote:
> would swallow any exceptions thrown by deferred1 and continue on to
> create deferred2. If you did:
>
> d.addCallback(foo)
> d.addCallback(bar)
> d.addCallback(baz)
>
> then an exception in "foo" would break the whole callback chain.
You can also use addBoth(), which adds a ca
That way works, but the original problem was that a failure in one of them
was stopping the whole callback chain.
Missing from my example (but present in a past example) was a try/except
around the yield keyword. So:
...
try:
yield deferred1
except:
pass
...
try:
yield deferred2
except:
Hello,
2009/9/17 Matt Perry :
> Make sure you're using the @inlineCallbacks decorator and the yield
> statement referenced previously. Without those you're just adding several
> callbacks to the same Deferred; with them, the function will wait until the
> Deferred fires before continuing.
>
> def
On Thu, Sep 17, 2009 at 4:35 AM, Matt Perry wrote:
> Make sure you're using the @inlineCallbacks decorator and the yield
> statement referenced previously. Without those you're just adding several
> callbacks to the same Deferred; with them, the function will wait until the
> Deferred fires befor
Make sure you're using the @inlineCallbacks decorator and the yield
statement referenced previously. Without those you're just adding several
callbacks to the same Deferred; with them, the function will wait until the
Deferred fires before continuing.
def logRequest(self, *arg, **kw):
obj = co
On Tue, Sep 15, 2009 at 6:21 PM, Pet wrote:
> On Tue, Sep 15, 2009 at 5:19 PM, Mark Visser wrote:
>> exar...@twistedmatrix.com wrote:
>>> On 10:37 am, petshm...@googlemail.com wrote:
I'd like to run several queries in background, some of them may fail.
>>>
>>> If you have a functio
On Tue, Sep 15, 2009 at 5:19 PM, Mark Visser wrote:
> exar...@twistedmatrix.com wrote:
>> On 10:37 am, petshm...@googlemail.com wrote:
>>>
>>> I'd like to run several queries in background, some of them may fail.
>>>
>>
>> If you have a function along the lines of this one:
>>
>> def someInter
exar...@twistedmatrix.com wrote:
> On 10:37 am, petshm...@googlemail.com wrote:
>>
>> I'd like to run several queries in background, some of them may fail.
>>
>
> If you have a function along the lines of this one:
>
> def someInteractions(db):
> interactions = [
> db.r
On 10:37 am, petshm...@googlemail.com wrote:
>Hi,
>
>I'd like to run several queries in background, some of them may fail.
>Currently, I do runInteraction for each query. Is there a way to run
>them all in one deferred, so that if one of them fails, other are not
>aborted?
If you have a function a