Trees | Index | Help |
---|
Package flumotion :: Package twisted :: Module flavors :: Class StateCacheable |
|
Jellyable
--+ |Serializable
--+ |Copyable
--+ |Cacheable
--+ | StateCacheable
ManagerAtmosphereState
,
ManagerComponentState
,
ManagerComponentUIState
,
ManagerFlowState
,
ManagerPlanetState
,
ManagerWorkerHeavenState
,
WorkerComponentUIState
,
WorkerJobState
I am a cacheable state object.
I cache key-value pairs, where values can be either single objects or list of objects.Method Summary | |
---|---|
__init__(self)
| |
Add a key to the state cache so it can be used with set. | |
Add a key for a list of objects to the state cache. | |
Append the given object to the given list. | |
Get the state cache value for the given key. | |
Get state to cache on the client and client-cache reference to observe locally. | |
hasKey(self,
key)
| |
Remove the given object from the given list. | |
Set a given state key to the given value. | |
This method is called when a client has stopped observing me. | |
Inherited from Cacheable | |
Return an appropriate tuple to serialize me. | |
Inherited from Copyable | |
Gather state to send when I am serialized for a peer. | |
Gather state to send when I am serialized for a particular perspective. | |
Determine what type tag to send for me. | |
Determine what type tag to send for me. | |
Inherited from Serializable | |
Return an ID which uniquely represents this object for this process. | |
Inherited from Jellyable | |
|
Class Variable Summary | |
---|---|
Inherited from Jellyable | |
tuple |
__implements__ = (<class 'twisted.spread.interfaces.IJel...
|
Method Details |
---|
addKey(self, key, value=None)Add a key to the state cache so it can be used with set. |
addListKey(self, key, value=None)Add a key for a list of objects to the state cache. |
append(self, key, value)Append the given object to the given list. Notifies observers of this Cacheable through observe_append. |
get(self, key, otherwise=None)Get the state cache value for the given key. Return otherwise in case where key is present but value None. |
getStateToCacheAndObserveFor(self, perspective, observer)Get state to cache on the client and client-cache reference to observe locally. This is similiar to getStateToCopyFor, but it additionally passes in a reference to the client-side RemoteCache instance that will be created when it is unserialized. This allows Cacheable instances to keep their RemoteCaches up to date when they change, such that no changes can occur between the point at which the state is initially copied and the client receives it that are not propogated.
|
remove(self, key, value)Remove the given object from the given list. Notifies observers of this Cacheable through observe_remove. |
set(self, key, value)Set a given state key to the given value. Notifies observers of this Cacheable through observe_set. |
stoppedObserving(self, perspective, observer)This method is called when a client has stopped observing me. The 'observer' argument is the same as that passed in to getStateToCacheAndObserveFor.
|
Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Tue Dec 20 15:33:10 2005 | http://epydoc.sf.net |