narupatools.state.view.wrappersΒΆ
Wrappers around Narupa classes to expose their shared states in a consistent way.
Both the client and the server have access to a shared state dictionary and can make modifications, however the API for each of these is slightly different.
SharedStateClientWrapper and SharedStateServerWrapper are implementations of the more general SerializableDictionary. SerializableDictionary is just a alias for a mutable mapping or dictionary from string keys to serializable values, which is what a shared state dictionary is. This exposes both shared state dictionaries in a pythonic and unified way, that is also compatible with using a standard dictionary for testing.
These classes are not intended to be use directly. Both NarupaImdClient and NarupaServer have a shared_state property which returns a SerializableDictionary, which uses these two classes internally.
Classes
|
Wrapper around a client shared state that exposes it as a mutable mapping. |
|
Wrapper around a state dictionary that exposes it as a mutable mapping. |