Added signal handler

This commit is contained in:
Joop Schilder 2019-01-16 17:24:06 +01:00
parent c0f4382cc9
commit ca094df37e

View File

@ -235,6 +235,18 @@ class Asynchronous
self::removedShmBlock();
});
/*
* The signal handler
*/
foreach([SIGINT, SIGTERM, SIGUSR1] as $signal)
pcntl_signal($signal, function($s) use (&$instance) {
if ($instance->isChild)
return;
self::killChildren();
self::awaitChildren();
self::removedShmBlock();
});
}
}