hio.core.uxd.peermemoing

hio.core.uxd.peermemoing Module

Module Contents

class hio.core.uxd.peermemoing.PeerMemoer(*, bc=4, **kwa)

Bases: hio.core.uxd.uxding.Peer, 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

hio.core.uxd.peermemoing.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

Parameters:
  • cls (Class) – instance of subclass instance

  • name (str) – 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.

  • temp (bool) – True means open in temporary directory, clear on close Otherwise open in persistent directory, do not clear on close

  • reopen (bool) – True (re)open with this init (default) False not (re)open with this init but later

  • clear (bool) – True means remove directory upon close when reopening False means do not remove directory upon close when reopening

  • filed (bool) – True means .path is file path not directory path False means .path is directory path not file path

  • extensioned (bool) – When not filed: True means ensure .path ends with fext False means do not ensure .path ends with fext

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()
class hio.core.uxd.peermemoing.PeerMemoerDoer(peer, **kwa)

Bases: 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

.peer

underlying transport instance subclass of Memoer

Type:

PeerMemoerDoer

enter(*, temp=None)

Do ‘enter’ context actions. Override in subclass. Not a generator method. Set up resources. Comparable to context manager enter.

Parameters:

temp (bool | None) – True means use temporary file resources if any None means ignore parameter value. Use self.temp

Inject temp or self.temp into file resources here if any

Doist or DoDoer winds its doers on enter

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)
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.