VirtualClient

For conceptual usage, see:

class pyrogue.interfaces.VirtualClient(addr='localhost', port=9099, linkTimeout=None, requestStallTimeout=None)[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

  • linkTimeout (float | None, default: None) – Idle timeout in seconds before the client marks the link down when no publish updates or successful replies have been observed. This is the primary operational timeout knob for both hardware and simulation applications.

  • requestStallTimeout (float | None, default: None) – Optional policy timeout for how long a single in-flight request may remain outstanding before the client declares the connection stalled. This is disabled by default and is typically only useful when a deployment has a well-defined upper bound for legitimate request time.

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.

property linkTimeout: float

Idle timeout in seconds before the link is considered down.

property requestStallTimeout: float | None

Optional maximum in-flight request age before it is treated as stalled.

setTimeoutConfig(*, linkTimeout=None, requestStallTimeout=None)[source]

Update link and request-stall timeout settings.

linkTimeout is the normal tuning knob for clients that need to tolerate longer busy periods. requestStallTimeout is an optional policy threshold and is most useful only when a deployment has a clear, finite upper bound for legitimate request duration.

Return type:

None

Parameters:
  • linkTimeout (float | None)

  • requestStallTimeout (float | None)

stop()[source]

Stop the monitor thread and release resources.

Return type:

None

property root: VirtualNode

Return the connected virtual root node.