[viff-devel] Weird behaviour
Martin Geisler
mg at lazybytes.net
Mon Aug 10 14:40:41 PDT 2009
Janus Dam Nielsen <janus.nielsen at 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/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.viff.dk/pipermail/viff-devel-viff.dk/attachments/20090810/f11e4962/attachment-0001.pgp>
More information about the viff-devel
mailing list