ManualClock
ManualClock
Section titled “ManualClock”Kind: class
Source: src/graphrefly/_clock.py:25
Signature
Section titled “Signature”ManualClock()Description
Section titled “Description”A clock that moves only by :meth:advance, for tests and the operator trace runner.
Timers due at the same instant fire in the order they were scheduled; a timer scheduled by a firing is due from that firing’s time, so one advance over several periods fires each.
Attributes
Section titled “Attributes”| Name | Type | Description |
|---|---|---|
now | float | |
pending | int | How many timers are waiting. |
Methods
Section titled “Methods”schedule
Section titled “schedule”schedule(delay_ms: float, callback: Callable[[], object]) -> Callable[[], None]Schedule callback at now + delay_ms; return its cancel function.
Source: src/graphrefly/_clock.py:38
advance
Section titled “advance”advance(ms: float) -> NoneMove the clock ms forward, firing each timer as the clock reaches it.
Source: src/graphrefly/_clock.py:54