Scans and removes non-emittable signals and processes.
Note
This DOES NOT flush the processor.
A signal is determined to be emittable only if it has installed processes that have not exhausted.
| Parameters: | boolean – Erase any history of removed signals. |
|---|---|
| Return type: | void |
Basic usage example demonstrating cleaning old signals and processes.
<?php
xp_signal(XP_SIG('Test'), xp_exhaust(1, function(){
echo 'SIG Test';
}));
xp_signal(XP_SIG('Test_2'), function(){
echo 'SIG Test 2';
});
xp_emit(XP_SIG('Test'));
xp_clean();
var_dump(xp_find_signal(XP_SIG('Test')));
The above code will output.
SIG Test null