dev-master
9999999-devWeb2All signal handling
MIT
The Requires
- php >=5.4
shell signal kill web2all
1.0.1
1.0.1.0Web2All signal handling
MIT
The Requires
- php >=5.4
shell signal kill web2all
Wallogit.com
2017 © Pedro Peláez
Web2All signal handling
This package can be used to easily enable signal handling in your commandline tool or daemon., (*1)
Catch signals sent to your program and allow you to handle them. By default catch kill -HUP, kill and ctrl-c.
It is intended for simple usage so you can gracefully shutdown your program., (*2)
$sh = new Web2All_Signal_Handler();
$sh->pcntlSignalSetup();
while(1){
// do stuff
sleep($time);
// you must call pcntlSignalDispatch regulary (preferably after each sleep)
// so all signals get handled. Signals will automatically interrupt the
// php sleep() command.
$sh->pcntlSignalDispatch();
if ($sh->pcntlSignalReceived()) break;
}
Web2All framework is open-sourced software licensed under the MIT license (https://opensource.org/licenses/MIT)., (*3)
Web2All signal handling
MIT
shell signal kill web2all
Web2All signal handling
MIT
shell signal kill web2all