Skip to content

Commit

Permalink
fix msg.client visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
nekufa committed Mar 14, 2024
1 parent c2231eb commit fb7bd3e
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/Message/Msg.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Msg extends Prototype
public ?int $timestampNanos = null;
public ?string $replyTo = null;

public readonly Client $client;
private ?Client $client = null;

public static function create(string $data): self
{
Expand Down Expand Up @@ -70,6 +70,11 @@ public function ack(): void
]));
}

public function getClient(): ?Client
{
return $this->client;
}

public function nack(float $delay = 0): void
{
$this->reply(new Ack([
Expand All @@ -81,14 +86,6 @@ public function nack(float $delay = 0): void
]));
}

public function progress(): void
{
$this->reply(new Ack([
'command' => '+WPI',
'subject' => $this->replyTo,
]));
}

public function parse($payload): self
{
$headers = [];
Expand Down Expand Up @@ -126,6 +123,14 @@ public function parse($payload): self
return $this;
}

public function progress(): void
{
$this->reply(new Ack([
'command' => '+WPI',
'subject' => $this->replyTo,
]));
}

public function render(): string
{
return 'MSG ' . json_encode($this);
Expand Down

0 comments on commit fb7bd3e

Please sign in to comment.