Refactored namespace

This commit is contained in:
Joop Schilder 2019-01-16 17:28:52 +01:00
parent ca094df37e
commit 4dfd90646c
4 changed files with 10 additions and 8 deletions

View File

@ -9,7 +9,7 @@
"autoload": { "autoload": {
"files": ["src/functions.php"], "files": ["src/functions.php"],
"psr-4": { "psr-4": {
"Joop\\Asynchronous\\": ["src"] "JoopSchilder\\Asynchronous\\": ["src"]
} }
}, },
"require": { "require": {

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Joop\Asynchronous; namespace JoopSchilder\Asynchronous;
/** /**
* Class Asynchronous * Class Asynchronous
@ -128,7 +128,7 @@ class Asynchronous
/** /**
* *
*/ */
public static function removedShmBlock() public static function removeShmBlock()
{ {
$instance = self::getInstance(); $instance = self::getInstance();
if (is_resource($instance->shm)) { if (is_resource($instance->shm)) {
@ -232,19 +232,20 @@ class Asynchronous
return; return;
self::awaitChildren(); self::awaitChildren();
self::removedShmBlock(); self::removeShmBlock();
}); });
/* /*
* The signal handler * The signal handler
*/ */
foreach([SIGINT, SIGTERM, SIGUSR1] as $signal) foreach([SIGHUP, SIGINT, SIGQUIT, SIGKILL, SIGTERM] as $signal)
pcntl_signal($signal, function($s) use (&$instance) { pcntl_signal($signal, function($s) use (&$instance) {
if ($instance->isChild) if ($instance->isChild)
return; return;
self::killChildren(); self::killChildren();
self::awaitChildren(); self::awaitChildren();
self::removedShmBlock(); self::removeShmBlock();
}); });
} }

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Joop\Asynchronous; namespace JoopSchilder\Asynchronous;
class Promise class Promise
{ {

View File

@ -1,6 +1,7 @@
<?php <?php
namespace Joop\Asynchronous; namespace JoopSchilder\Asynchronous;
if (!function_exists('async_run')) { if (!function_exists('async_run')) {