[Twisted-Python] PB referenceable and cacheable

Jason Valenzuela jvalenzuela1977 at gmail.com
Sun May 23 03:59:42 EDT 2010


In an effort to learn Twisted, I am working on a set of small client and 
server applications which utilize PB as IPC. The server hosts a group of 
simple parameters that clients may monitor or set. For a client to 
monitor a parameter's value, it seems that the server should create the 
parameter as a cacheable. To allow a client to modify the parameter, a 
referenceable looks like the right path. Of course, I would like to 
consume cake as well as posses it, wanting properties of both cacheable 
and referenceable. Looking at the source code, it doesn't look like 
subclassing from both pb.referenceable and pb.cacheable is a good idea 
as each has different ideas on how to get jellied. Currently, I'm 
thinking about just creating the parameter as a normal object that 
contains two PB objects: a referenceable and a cacheable. The former 
handles incoming requests to change the parameter's value, and the 
latter keeping clients updated with the current value. Is that a sane 
approach, or am I reinventing the wheel?


Thanks,
Jason Valenzuela




More information about the Twisted-Python mailing list