@@ -11,6 +11,9 @@ |
||
| 11 | 11 | private $queuedCount = 0; |
| 12 | 12 | private $dequeuedCount = 0; |
| 13 | 13 | |
| 14 | + /** |
|
| 15 | + * @param integer $ownerPid |
|
| 16 | + */ |
|
| 14 | 17 | public function __construct($ownerPid) |
| 15 | 18 | { |
| 16 | 19 | $this->ownerPid = $ownerPid; |
@@ -50,15 +50,15 @@ |
||
| 50 | 50 | } |
| 51 | 51 | $pid = getmypid(); |
| 52 | 52 | switch (true) { |
| 53 | - case $this->ownerPid === $pid: |
|
| 54 | - $role = 'owner'; |
|
| 55 | - break; |
|
| 56 | - case $this->masterPid !== null && $this->masterPid === $pid: |
|
| 57 | - $role = 'master'; |
|
| 58 | - break; |
|
| 59 | - default: |
|
| 60 | - $role = 'worker'; |
|
| 61 | - break; |
|
| 53 | + case $this->ownerPid === $pid: |
|
| 54 | + $role = 'owner'; |
|
| 55 | + break; |
|
| 56 | + case $this->masterPid !== null && $this->masterPid === $pid: |
|
| 57 | + $role = 'master'; |
|
| 58 | + break; |
|
| 59 | + default: |
|
| 60 | + $role = 'worker'; |
|
| 61 | + break; |
|
| 62 | 62 | } |
| 63 | 63 | fputs( |
| 64 | 64 | $this->destination, |
@@ -11,6 +11,9 @@ |
||
| 11 | 11 | private $queuedCount = 0; |
| 12 | 12 | private $dequeuedCount = 0; |
| 13 | 13 | |
| 14 | + /** |
|
| 15 | + * @param integer $ownerPid |
|
| 16 | + */ |
|
| 14 | 17 | public function __construct($ownerPid) |
| 15 | 18 | { |
| 16 | 19 | $this->ownerPid = $ownerPid; |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | /** |
| 17 | 17 | * @param callable $callable |
| 18 | 18 | * @param array $args |
| 19 | - * @param string $string |
|
| 19 | + * @param string|null $tag |
|
| 20 | 20 | */ |
| 21 | 21 | public function __construct($callable, $args, $tag) |
| 22 | 22 | { |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | - * @return string|null |
|
| 63 | + * @return string |
|
| 64 | 64 | */ |
| 65 | 65 | public function getTag() |
| 66 | 66 | { |
@@ -180,6 +180,7 @@ discard block |
||
| 180 | 180 | * fork worker process |
| 181 | 181 | * |
| 182 | 182 | * @param \Ackintosh\Snidel\Task |
| 183 | + * @param Task $task |
|
| 183 | 184 | * @return void |
| 184 | 185 | * @throws \RuntimeException |
| 185 | 186 | */ |
@@ -239,7 +240,7 @@ discard block |
||
| 239 | 240 | * @param mixed $args |
| 240 | 241 | * @param string $tag |
| 241 | 242 | * @param \Ackintosh\Snidel\Token $token |
| 242 | - * @return void |
|
| 243 | + * @return integer |
|
| 243 | 244 | * @throws \RuntimeException |
| 244 | 245 | */ |
| 245 | 246 | public function forkSimply($callable, $args = array(), $tag = null, Token $token = null) |