hio.base.hier.dusqing ===================== .. py:module:: hio.base.hier.dusqing .. autoapi-nested-parse:: hio.base.hier.dusqing Module Provides durable set queue for hold hierarchical actions Module Contents --------------- .. py:class:: Dusq(*pa) Dusq (durable set queue) class when injected with .sdb and .key will store its ordered set durably and allow access as a deduped FIFO queue. A set is deduped. Properties: stale (bool): True means in-memory and durable on disk not synced. False means in-memory and durable on disk synced. durable (bool): True means ._sdb and ._key and ._sdb.db and ._sdb.db.opened are not None. False otherwise. Hidden: _oset (oset): in-memory cache as ordered set _sdb (DomIoSuber): instance of durable store _key (str): into .sdb _stale (bool): stale-status cache for .stale property. .. py:property:: stale Getter for ._stale :returns: True means in-memory and durable on disk not synced; False means in-memory and durable on disk synced :rtype: stale (bool) .. py:property:: durable Property durable True when durable subdb injected and opened. Returns:: durable (bool): True means ._sdb and ._key and ._sdb.db and ._sdb.db.opened are not None False otherwise .. py:method:: update(vals: hio.help.NonStringIterable[hio.help.RegDom | hio.help.IceRegDom], *, deep=True) Update ._oset with vals Performs equivalent operation on durable .sdb at .key if any :param vals: to add to dusq :type vals: NonStringIterable[hio.help.doming.RegDom] :param deep: True means deepcopy to ensure can't mutate outside False means do not deepcopy :type deep: bool .. py:method:: push(val: hio.help.RegDom | hio.help.IceRegDom) If not None, add val add val to last in if unique. Otherwise ignore Performs equivalent operation on durable .sdb at .key if any :param val: element to be appended to deck (deque) :type val: hio.help.doming.RegDom .. py:method:: pull(emptive=True) Remove and return first in val If empty and emptive return None else raise IndexError Performs equivalent operation on durable .sdb at .key if any Parameters:: emptive (bool): True means return None instead of raise IndexError when attempt to pull False means normal behavior of deque .. py:method:: clear() Clear all values Performs equivalent operation on durable .sdb at .key if any .. py:method:: remove(value: hio.help.RegDom | hio.help.IceRegDom) Remove value if contained Returns:: result (bool): True value was removed Raises KeyError if value not found Performs equivalent operation on durable .sdb at .key if any .. py:method:: put(vals: hio.help.NonStringIterable[hio.help.RegDom | hio.help.IceRegDom]) Put (append) vals to .sdb at .key if any and unique to set .. py:method:: add(val) Add value to .sdb at .key if any .. py:method:: pop() Pop value from .sdb at .key if any .. py:method:: rem(val=None) Remove all values from .sdb at .key if any .. py:method:: cnt() Count all values in .sdb at .key if any .. py:method:: pin() Pins all of ._oset to ._sdb at ._key if any. Sets ._stale to False on success .. py:method:: sync(force=False) Syncs by checking exists durable copy in ._sdb at ._key. If so and ._stale or force then reads own data from ._sdb at ._key if any. If not attempts to write to ._sdb at ._key Parameters:: force (bool): True means force read even if not ._stale False means do not force read