class documentation

class WaitingClock:

Constructor: WaitingClock(now)

View In Hierarchy

When each Binding last stopped being Satisfied.

The introspection Component samples the same booleans the status codes are written from, once every ~opensmi.ros2.server.required.LOSS_INTERVAL seconds and again whenever a report is asked for, and remembers the first sample at which each Binding was not satisfied. Sampling reads flags other tasks already maintain, so it puts nothing on the wire and never starts the graph poll.

Method __init__ Start out knowing nothing.
Method __repr__ Return a representation naming how many Bindings are currently waiting.
Method note Record one sample of one Binding's satisfaction.
Method waiting_since Return when one Binding last stopped being Satisfied, or None if it has not.
Instance Variable _now Undocumented
Instance Variable _since Undocumented
def __init__(self, now: Callable[[], dt.datetime] = _utc_now):

Start out knowing nothing.

Parameters
now:Callable[[], dt.datetime]Reads the wall clock. Tests inject their own.
def __repr__(self) -> str:

Return a representation naming how many Bindings are currently waiting.

def note(self, key: tuple[str, str], *, satisfied: bool | None):

Record one sample of one Binding's satisfaction.

A satisfied Binding, or one whose kind has no presence to read, forgets its waiting time, so a sensor that returns and leaves again is reported waiting since the second departure.

def waiting_since(self, key: tuple[str, str]) -> dt.datetime | None:

Return when one Binding last stopped being Satisfied, or None if it has not.

_now =

Undocumented

_since: dict[tuple[str, str], dt.datetime] =

Undocumented