hio.base.hier.durqing ===================== .. py:module:: hio.base.hier.durqing .. autoapi-nested-parse:: hio.base.hier.durqing Module Provides durable queue for hold hierarchical actions Module Contents --------------- .. py:class:: Durq(*pa) Durq (durable queue) class when injected with .sdb and .key will store its ordered list durably and allow access as a FIFO queue 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: _deq (deque): in-memory cache as deque _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:: extend(vals: hio.help.NonStringIterable[hio.help.RegDom | hio.help.IceRegDom]) Extend ._deq with vals Performs equivalent operation on durable .sdb at .key if any .. py:method:: push(val: hio.help.RegDom | hio.help.IceRegDom) If not None, add val to last in. 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 value 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 from deque Performs equivalent operation on durable .sdb at .key if any .. py:method:: count(value) Returns count of entries in ._deq equal to value .. py:method:: put(vals: hio.help.NonStringIterable[hio.help.RegDom | hio.help.IceRegDom]) Put (append) vals to .sdb at .key if any .. 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() 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 ._deq 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