EtcdStorage

Inheritance diagram of EtcdStorage

EtcdStorage inheritance diagram

class savant.parameter_storage.EtcdStorage(**kwargs)

Manages cached access to value from etcd storage.

register_parameter(name, default_value=None)

Registers static parameter.

Parameters:
  • name (str) – Parameter name.

  • default_value (Optional[Any]) – Default value for a given name.

register_dynamic_parameter(name, default_value=None, on_change=None)

Prepare the manager to be able to return some value for a given name. Try to get value from storage, fallback to default in case of fail. Try to add watch for name.

Parameters:
  • name (str) – Parameter name in etcd.

  • default_value (Optional[Any]) – Default value for a given name, if skipped and storage request failed then subsequent __getitem__ calls may fail.

  • on_change (Optional[Callable]) – Additional user specified action to perform on decoded event value from watch response.