pip_services3_components.state.NullStateStore module

class pip_services3_components.state.NullStateStore.NullStateStore

Bases: pip_services3_components.state.IStateStore.IStateStore

Dummy state store implementation that doesn’t do anything.

It can be used in testing or in situations when state management is not required but shall be disabled.

See: ICache

delete(correlation_id: Optional[str], key: str) → Any

Deletes a state from the store by its key.

Parameters
  • correlation_id – (optional) transaction id to trace execution through call chain.

  • key – a unique value key.

Returns

deleted item

load(correlation_id: Optional[str], key: str) → Any

Loads state from the store using its key. If value is missing in the stored it returns None.

Parameters
  • correlation_id – (optional) transaction id to trace execution through call chain.

  • key – a unique state key.

Returns

the state value or None if value wasn’t found.

load_bulk(correlation_id: Optional[str], keys: List[str]) → List[pip_services3_components.state.StateValue.StateValue]

Loads an array of states from the store using their keys.

Parameters
  • correlation_id – (optional) transaction id to trace execution through call chain.

  • keys – unique state keys.

Returns

an array with state values and their corresponding keys.

save(correlation_id: Optional[str], key: str, value: Any) → Any

Saves state into the store.

Parameters
  • correlation_id – (optional) transaction id to trace execution throug

  • key – a unique state key.

  • value – a state value.

Returns

The state that was stored in the store.