Janus Dam Nielsen <janus.niel...@alexandra.dk> writes:

> Hi Martin
> Thanks for your thoughts on this.

You're welcome, it took a me a while to figure out what was wrong here.

>> I think the take-home message is that you have structured your code
>> in an unusual way. Whenever you add a callback to a Deferred but keep
>> referring to the Deferred inside the callback, then you're off track.
>> At least that's my experience :-)
> Actually I think you are slightly off :)
> Lets look at what the example does:
> First, the Deferred a is created
> Second, the callback r is created,
> Third, a callback, append, is attached to a
> Forth, r is added to values
> Fifth, r is returned
> What seems to be the problem is the returning of a deferred from a
> callback in combination with holding on to a reference to it in the
> callback.

Yes, when you return a Deferred, it loses its value. The value is
transferred to the other Deferred.

Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.

Attachment: pgpoBGTSUGgbI.pgp
Description: PGP signature

viff-devel mailing list (http://viff.dk/)

Reply via email to