Added signal handler

This commit is contained in:
Joop Schilder committed 2019-01-16 17:24:06 +01:00
1 parent c0f4382cc9
commit ca094df37e
1 file changed
+12
+12
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();
});
}
}