pub fn run_event_loop() -> Result<(), String>Expand description
Drive the event loop to quiescence.
Two regimes, selected per iteration by open_handles:
- No open handles (pure script / timers only): the original deterministic
virtual clock — drain microtasks, fire the earliest
(delay, seq)timer immediately (no real waiting), repeat until both queues empty, then EXIT. Parity output and test speed are unchanged. - Open handles (a server is listening / sockets are live): drain
microtasks, fire every timer whose real deadline has passed, then BLOCK on
the I/O channel (
recv_timeoutbounded by the next timer’s real deadline, or unboundedrecvif no timers) and run the receivedIoTaskon the main thread. The host keeps its ownSender, sorecvnever disconnects while the process should stay alive.
Errors thrown by a task/timer/I/O dispatch abort the loop (uncaught → surfaced).