hio.core.uxd.peermemoing ======================== .. py:module:: hio.core.uxd.peermemoing .. autoapi-nested-parse:: hio.core.uxd.peermemoing Module Module Contents --------------- .. py:class:: PeerMemoer(*, bc=4, **kwa) Bases: :py:obj:`hio.core.uxd.uxding.Peer`, :py:obj:`hio.core.memo.Memoer` Class for sending memograms over UXD transport Mixin base classes Peer and Memoer to attain memogram over uxd transport. Inherited Class Attributes: See Peer Class See memoing.Memoer Class Inherited Attributes: See Peer Class See Memoer Class Inherited Properties: See Peer Class See Memoer Class .. py:function:: openPM(cls=None, name='test', temp=True, reopen=True, clear=True, filed=False, extensioned=True, **kwa) Wrapper to create and open UXD PeerMemoer instances When used in with statement block, calls .close() on exit of with block :param cls: instance of subclass instance :type cls: Class :param name: unique identifier of PeerMemoer peer. Enables management of transport by name. Provides unique path part so can have many peers each at different paths but in same directory. :type name: str :param temp: True means open in temporary directory, clear on close Otherwise open in persistent directory, do not clear on close :type temp: bool :param reopen: True (re)open with this init (default) False not (re)open with this init but later :type reopen: bool :param clear: True means remove directory upon close when reopening False means do not remove directory upon close when reopening :type clear: bool :param filed: True means .path is file path not directory path False means .path is directory path not file path :type filed: bool :param extensioned: When not filed: True means ensure .path ends with fext False means do not ensure .path ends with fext :type extensioned: bool See filing.Filer and uxding.Peer for other keyword parameter passthroughs Usage:: with openPM() as peer: peer.receive() with openPM(cls=PeerMemoerSubclass) as peer: peer.receive() .. py:class:: PeerMemoerDoer(peer, **kwa) Bases: :py:obj:`hio.base.doing.Doer` PeerMemoerDoer Doer for reliable UXD transport. Does not require retry tymers. See Doer for inherited attributes, properties, and methods. To test in WingIde must configure Debug I/O to use external console .. attribute:: .peer underlying transport instance subclass of Memoer :type: PeerMemoerDoer .. py:method:: enter(*, temp=None) Do 'enter' context actions. Override in subclass. Not a generator method. Set up resources. Comparable to context manager enter. :param temp: True means use temporary file resources if any None means ignore parameter value. Use self.temp :type temp: bool | None Inject temp or self.temp into file resources here if any Doist or DoDoer winds its doers on enter .. py:method:: recur(tyme) Do 'recur' context actions. Override in subclass. Regular method that perform repetitive actions once per invocation. Assumes resource setup in .enter() and resource takedown in .exit() (see ReDoer below for example of .recur that is a generator method) Returns completion state of recurrence actions: True means done, False means continue. Doist provides the time value. .recur maybe implemented by a subclass either as a non-generator method or a generator method. This stub here is as a non-generator method. The base class .do detects which type:: If non-generator .do method runs .recur method once per iteration until .recur returns (True) If generator .do method runs .recur with (yield from) until .recur returns (see ReDoer for example of generator .recur) .. py:method:: exit() Do 'exit' context actions. Override in subclass. Not a generator method. Clean up resources. Comparable to context manager exit. Called by finally after normal return, close, or abort. After .exit() do returns resulting in StopIteration.