Skip to content

Commit

Permalink
Fixed shared memory writing and fork losing received messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ghola committed Mar 17, 2016
1 parent 530fcf5 commit 5151098
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Spork/Fork.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Fork implements DeferredInterface
private $name;
private $status;
private $message;
private $messages = array();

public function __construct($pid, SharedMemory $shm, $debug = false)
{
Expand Down Expand Up @@ -92,8 +93,7 @@ public function processWaitStatus($status)

public function receive()
{
$messages = array();

$messages = array();
foreach ($this->shm->receive() as $message) {
if ($message instanceof ExitMessage) {
$this->message = $message;
Expand Down Expand Up @@ -135,6 +135,11 @@ public function getError()
}
}

public function getMessages()
{
return $this->messages;
}

public function isSuccessful()
{
return 0 === $this->getExitStatus();
Expand Down

0 comments on commit 5151098

Please sign in to comment.