Begins the XPSPL event wait loop.
The event loop must be started to allow execution of time, networking or complex loop based signals.
Note
XPSPL provides an executable xpspl in the bin directory for automatically loading code into the event loop.
Warning
This is a BLOCKING function.
Any code underneath the function call will NOT be executed until the processor halts execution.
| Return type: | void |
|---|
Basic usage example demonstrating using the loop for time based code.
<?php
// Import time module
xp_import('time');
xp_time\awake(10, function(){
echo '10 seconds passed';
});
xp_wait_loop();
The processor loop has built in support for automatically shutting down when it detects there is nothing else it will ever do.
This example demonstrates the loop shutting down after emitting 5 time based signals.