class documentation

class MemoryDriver: (source)

View In Hierarchy

In-memory TimeDriver that only moves when advance is called.

Method advance Advance the clock of this driver by delta seconds.
Method isScheduled Does this driver currently have work scheduled with it?
Method now TimeDriver.now
Method reschedule Schedule the given work to happen at the given time.
Method unschedule TimeDriver.unschedule
Class Variable _currentTime Undocumented
Instance Variable _scheduledWork Undocumented
def advance(self, delta: Optional[float] = None) -> float|None: (source)

Advance the clock of this driver by delta seconds.

If no delta is provided, then advance until the next scheduled time when this driver would run something.

Returns
float|Nonethe amount of time that was advanced, or None if no work was scheduled.
def isScheduled(self) -> bool: (source)

Does this driver currently have work scheduled with it?

def reschedule(self, desiredTime: float, work: Callable[[], None]): (source)

Schedule the given work to happen at the given time.

See Also
TimeDriver.reschedule
Note
In order to avoid infinite loops where time is not moving forward while work is being scheduled at the current moment or in the past, time (as referenced by MemoryDriver.now) will always advance by at least one ULP, so if desiredTime is before or exactly now, by the time work is run, now will be very slightly greater.
_currentTime: float = (source)

Undocumented

_scheduledWork = (source)

Undocumented