addListener(self,
listener,
set=None,
append=None,
remove=None,
setitem=None,
delitem=None,
invalidate=None,
set_=None)
| source code
|
Adds a listener to the remote cache.
The caller will be notified of state events via the functions given as
the 'set_', 'append', and 'remove', 'setitem', and 'delitem' keyword
arguments.
Always call this method using keyword arguments for the functions;
calling them with positional arguments is not supported.
Setting one of the event handlers to None will ignore that event. It
is an error for all event handlers to be None.
- Parameters:
listener (object implementing flumotion.twisted.flavors.IStateListener) - new listener object that wants to receive cache state change
notifications.
set_ (procedure(object, key, value) -> None) - procedure to call when a value is set
append (procedure(object, key, value) -> None) - procedure to call when a value is appended to a list
remove (procedure(object, key, value) -> None) - procedure to call when a value is removed from a list
setitem (procedure(object, key, subkey, value) -> None) - procedure to call when a value is set in a dict
delitem (procedure(object, key, subkey, value) -> None) - procedure to call when a value is removed from a dict.
invalidate (procedure(object) -> None) - procedure to call when this cache has been invalidated.
|