savin/pcntl

This package is abandoned and no longer maintained. No replacement package was suggested.

Laravel package to work with the OS signals.

dev-master 2019-03-18 11:08 UTC

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();
}