savin / pcntl
Laravel package to work with the OS signals.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/savin/pcntl
Requires
- ext-pcntl: *
- illuminate/support: ~5
This package is auto-updated.
Last update: 2021-06-18 16:44:05 UTC
README
Laravel package to work with the OS signals.
Installation
Via Composer
$ composer require savin/pcntl
Usage
$pcnl = PCNTL::create([SIGINT, SIGTERM, SIGHUP]);
while (true) {
if ($pcnl->dispatch()->getLastSigno()) break;
}
echo $pcnl->getLastMessage();
$terminate = false;
$pcnl = PCNTL::create([SIGINT, SIGTERM], function($signal) use(&$terminate) {
$terminate = $signal;
});
while (!$terminate) {
$pcnl->dispatch();
}