VirtualClient

class pyrogue.interfaces.VirtualClient(addr='localhost', port=9099)[source]

A full featured client interface for Rogue. This can be used in scripts or other clients which require remote access to the running Rogue instance.

This class ues a custom factory ensuring that only one instance of this class is created in a python script for a given remote connection.

Parameters:
  • addr (str, default: 'localhost') – host address

  • port (int, default: 9099) – host port

Variables:
  • linked (bool) – link state

  • root (obj) – root class reference

Return type:

VirtualClient

addLinkMonitor(function)[source]

Add a link monitor callback function. This function will be called any time the link state changes. A single boolean argument will be passed to the callback function containing the current link state.

Parameters:

function (Callable[[bool], None]) – Callback function with the form function(linkState: bool).

Return type:

None

remLinkMonitor(function)[source]

Remove a previously added link monitor function.

Parameters:

function (Callable[[bool], None]) – Previously registered callback function.

Return type:

None

property linked: bool

Whether the client is currently linked to the server.

stop()[source]

Stop the monitor thread and release resources.

Return type:

None

property root: VirtualNode

Return the connected virtual root node.