[Twisted-Python] _Dereference problems with jelly, pb.Cacheable, and cyclic references
Sebastian Hanlon
sebastian.hanlon at uleth.ca
Thu Jun 23 19:25:43 EDT 2005
I'm having problems trying to spread a data structure using
pb.Cacheable. The general framework involves three classes: Alpha,
Bravo, and Charlie. Alpha maintains a list of Bravos and Charlies.
Bravos can reference Charlies and Charlies reference Bravos. When they
get unserialized, though, some of the Charlies have _Dereference objects
where references to Bravos should be. The Bravos themselves come across
the wire just fine.
A simple example program is attached. To run it, first start the server
by running 'python jelly-test.py server', then run the client with
'python jelly-test.py client'. You should get a _Dereference in the list
of Charlies printed by the client, like such:
--cut here--
bravos:
Bravo(0) [<__main__.RemoteCharlie instance at 0x00C14DA0>]
Bravo(1) [<__main__.RemoteCharlie instance at 0x00C14DA0>,
<__main__.RemoteCharlie instance at 0x00C19058>]
Bravo(2) [<__main__.RemoteCharlie instance at 0x00C19058>]
--------------------------------------------------
charlies:
Charlie(Bravo(0),Bravo(1))
Charlie(<twisted.persisted.crefutil._Dereference instance at
0x00C190A8>,Bravo(2))
--cut here--
Can anyone help? I'm running the latest Twisted SVN on Python 2.3.4.
-Sebastian
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: jelly-test.py
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20050623/c637f14c/attachment.txt
More information about the Twisted-Python
mailing list