[Twisted-Python] Do Viewables absolutely have to be return'ed by Avatars?

Daniel Sank sank.daniel at gmail.com
Wed Nov 20 16:54:58 MST 2013


>From some experimentation I find that the only way to make a Viewable
get a meaningful perspective argument when executing view_* methods is
to make sure that the references to that Viewable are given to clients
as return values from perspective_* methods called on a pb.Avatar.

In particular, if the Avatar gives a client a reference to a Viewable
by passing it as an argument to a remote_* method on the client,
subsequent invocations of view_* methods by the client result in
perspective argument in view_* methods being None.

I have attached a complete working example of a client and server that
succinctly illustrates this issue.

Question: Is there a way to distribute un-asked for references to
Viewables that properly get the perspective argument in their view_*
methods?

Sincerely,
Daniel Sank
-------------- next part --------------
A non-text attachment was scrubbed...
Name: client.py
Type: text/x-python
Size: 837 bytes
Desc: not available
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20131120/b4f53395/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: server.py
Type: text/x-python
Size: 1201 bytes
Desc: not available
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20131120/b4f53395/attachment-0001.py>


More information about the Twisted-Python mailing list