[Twisted-Python] Is a Viewable Cacheable a good idea?

Daniel Sank sank.daniel at gmail.com
Sun Nov 17 10:13:43 MST 2013


> So may be (IMHO) you could have one viewable object acting like a stockroom-manager
> that clients will (remote)call to make changes on the server side stockroom-object, and
> a cacheable stockroom-object, that you will sync with client.

Now that I've been working on this for a while and understand what
_doesn't_ work I see why your suggestion here is a very good one.
Thank you.

The one funny aspect of using a single manager object is that whenever
I want to modify an element in the stockroom I have to pass the
manager a reference to the object I'm trying to modify:

myViewpointToTheManager.callRemote("purchaseItem", myRemoteCacheOfSomeItem)

It seems slightly distasteful to have to call a generic purchase
method for _any_ object I might want to buy.

That said I think I've figured out a good way to handle this whole
thing. I attach to this email a file containing some classes that
allow interaction both by talking to a Viewable manager or by invoking
remote methods on the managed objects themselves. An explanation of
intended use is given in the source code.

I hope this is helpful to others.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: viewableCacheable.py
Type: application/binary
Size: 4325 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20131117/8e577a3a/attachment-0002.bin>


More information about the Twisted-Python mailing list