Skip to content

Commit

Permalink
Merge pull request #8 from reactphp-parallel/transfer-payloads-as-str…
Browse files Browse the repository at this point in the history
…ings

Transfer payloads as strings
  • Loading branch information
WyriHaximus committed Jul 24, 2020
2 parents f316846 + 4e58735 commit f8f5902
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/Message/Error.php
Expand Up @@ -9,12 +9,12 @@
final class Error implements NegativeOutcome
{
private string $id;
private UnitOfError $error;
private string $error;

public function __construct(string $id, UnitOfError $error)
{
$this->id = $id;
$this->error = $error;
$this->error = serialize($error);
}

public function id(): string
Expand All @@ -24,6 +24,6 @@ public function id(): string

public function error(): UnitOfError
{
return $this->error;
return unserialize($this->error);
}
}
6 changes: 3 additions & 3 deletions src/Message/Result.php
Expand Up @@ -9,12 +9,12 @@
final class Result implements PositiveOutcome
{
private string $id;
private UnitOfResult $result;
private string $result;

public function __construct(string $id, UnitOfResult $result)
{
$this->id = $id;
$this->result = $result;
$this->result = serialize($result);
}

public function id(): string
Expand All @@ -24,6 +24,6 @@ public function id(): string

public function result(): UnitOfResult
{
return $this->result;
return unserialize($this->result);
}
}
6 changes: 3 additions & 3 deletions src/Message/Work.php
Expand Up @@ -10,12 +10,12 @@
final class Work implements Message
{
private string $id;
private UnitOfWork $work;
private string $work;

public function __construct(string $id, UnitOfWork $work)
{
$this->id = $id;
$this->work = $work;
$this->work = serialize($work);
}

public function id(): string
Expand All @@ -25,6 +25,6 @@ public function id(): string

public function work(): UnitOfWork
{
return $this->work;
return unserialize($this->work);
}
}

0 comments on commit f8f5902

Please sign in to comment.