savin/pcntl

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

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

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