daemon.stores.base module

class daemon.stores.base.BaseStore[source]

Bases: collections.abc.MutableMapping

The Base class for Daemon stores

add(*args, **kwargs)[source]

Add a new element to the store. This method needs to be overridden by the subclass

Return type

DaemonID

update(*args, **kwargs)[source]

Updates the element to the store. This method needs to be overridden by the subclass

Return type

DaemonID

delete(*args, **kwargs)[source]

Deletes an element from the store. This method needs to be overridden by the subclass

Return type

DaemonID

clear()[source]

Deletes an element from the store. This method needs to be overridden by the subclass

Return type

None

keys()[source]

Get keys in the store

Return type

Sequence[DaemonID]

Returns

Keys in the local store

values()[source]

Get values in the store

Return type

Sequence[Union[ForwardRef, ForwardRef]]

Returns

Values in the local store

items()[source]

Get items in the store

Return type

Sequence[Tuple[ForwardRef, Union[ForwardRef, ForwardRef]]]

Returns

Items in the local store

classmethod dump(func)[source]

Dump store as a pickle to local workspace

Parameters

func – function to be wrapped

Return type

Callable

Returns

decorator for dump

classmethod load()[source]

Load store from a pickle in local workspace

Return type

BaseStore

Returns

Store from local or empty store

reset()[source]

Calling clear() and reset all stats

Return type

None