class documentation

class GraphFacet:

Constructor: GraphFacet(read, interval)

View In Hierarchy

What is on the ROS2 graph, read on a timer while anything is watching (see Runtime.graph).

Method __init__ Describe a facet without reading anything.
Method __repr__ Return a representation naming the poll state and how often it has read.
Async Method close End every watch and stop the poll, which is what stopping the Runtime does to it.
Async Method refresh Read the graph once, now, and hold the result. Counts as a poll.
Async Method settle Stop the poll if nothing is watching any more. Called by a watch as it closes.
Method watch Register interest in the graph, starting the poll if it was not running.
Property interval Return the seconds between reads while anything is watching.
Property polling Return whether the poll is running, which is exactly while a watch is open.
Property polls Return how often the graph has been read (0 for a fully declared Machine).
Property snapshot Return the graph as the last read left it (empty before the first one).
Async Method _poll Read the graph on the interval and wake every watch, until cancelled.
Method _start Start the poll loop, unless it is already running or nothing is watching.
Instance Variable _interval Undocumented
Instance Variable _polls Undocumented
Instance Variable _read Undocumented
Instance Variable _snapshot Undocumented
Instance Variable _task Undocumented
Instance Variable _watches Undocumented
def __init__(self, *, read: Callable[[], Awaitable[GraphSnapshot]], interval: float = POLL_INTERVAL):

Describe a facet without reading anything.

Parameters
read:Callable[[], Awaitable[GraphSnapshot]]How to read the graph once.
interval:floatSeconds between reads while anything is watching.
def __repr__(self) -> str:

Return a representation naming the poll state and how often it has read.

async def close(self):

End every watch and stop the poll, which is what stopping the Runtime does to it.

async def refresh(self) -> GraphSnapshot:

Read the graph once, now, and hold the result. Counts as a poll.

async def settle(self):

Stop the poll if nothing is watching any more. Called by a watch as it closes.

def watch(self) -> GraphWatch:

Register interest in the graph, starting the poll if it was not running.

Returns
GraphWatchA handle carrying the deltas. The poll stops when the last watch closes.
@property
interval: float =

Return the seconds between reads while anything is watching.

@property
polling: bool =

Return whether the poll is running, which is exactly while a watch is open.

@property
polls: int =

Return how often the graph has been read (0 for a fully declared Machine).

@property
snapshot: GraphSnapshot =

Return the graph as the last read left it (empty before the first one).

async def _poll(self):

Read the graph on the interval and wake every watch, until cancelled.

def _start(self):

Start the poll loop, unless it is already running or nothing is watching.

_interval =

Undocumented

_polls: int =

Undocumented

_read =

Undocumented

_snapshot =

Undocumented

_task: asyncio.Task[None] | None =

Undocumented

_watches: list[GraphWatch] =

Undocumented