Package lamson :: Module routing :: Class MemoryStorage
[hide private]
[frames] | no frames]

Class MemoryStorage

source code


The default simplified storage for the Router to hold the states. This should only be used in testing, as you'll lose all your contacts and their states if your server shutsdown. It is also horribly NOT thread safe.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
get(self, key, sender)
You must implement this so that it returns a single string of either the state for this combination of arguments, OR the ROUTE_FIRST_STATE setting.
source code
 
set(self, key, sender, state)
Set should take the given parameters and consistently set the state for that combination such that when StateStorage.get is called it gives back the same setting.
source code
 
key(self, key, sender) source code
 
clear(self)
This should clear ALL states, it is only used in unit testing, so you can have it raise an exception if you want to make this safer.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

get(self, key, sender)

source code 

You must implement this so that it returns a single string of either the state for this combination of arguments, OR the ROUTE_FIRST_STATE setting.

Overrides: StateStorage.get
(inherited documentation)

set(self, key, sender, state)

source code 

Set should take the given parameters and consistently set the state for that combination such that when StateStorage.get is called it gives back the same setting.

Overrides: StateStorage.set
(inherited documentation)

key(self, key, sender)

source code 

clear(self)

source code 

This should clear ALL states, it is only used in unit testing, so you can have it raise an exception if you want to make this safer.

Overrides: StateStorage.clear
(inherited documentation)