registerAction static method
- int timestamp,
- dynamic action(
Registers an abritrary action
to be executed at timestamp
time.
The action
, if it returns a Future, will be await
ed.
Implementation
static void registerAction(int timestamp, dynamic Function() action) {
if (timestamp < _currentTimestamp) {
throw Exception('Cannot add timestamp "$timestamp" in the past.'
' Current time is ${Simulator.time}');
}
if (!_pendingTimestamps.containsKey(timestamp)) {
_pendingTimestamps[timestamp] = ListQueue();
}
_pendingTimestamps[timestamp]!.add(action);
}