Skip to content

Commit

Permalink
Merge pull request #4 from adam-lmi/main
Browse files Browse the repository at this point in the history
Replace PHP_INT_MAX with config timeout in Client
  • Loading branch information
nekufa authored Mar 25, 2022
2 parents 76f6b95 + cfd01f7 commit d3e9cef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function connect(): self
$this->connect->name = $this->name;
}
$this->send($this->connect);
$this->process(PHP_INT_MAX);
$this->process($config->timeout);
}

return $this;
Expand Down Expand Up @@ -131,7 +131,7 @@ public function ping(): bool
$timestamp = microtime(true);
$this->send(new Ping([]));

return $timestamp <= $this->process(PHP_INT_MAX);
return $timestamp <= $this->process($this->configuration->timeout);
}

public function publish(string $name, mixed $payload, ?string $replyTo = null): self
Expand All @@ -153,7 +153,7 @@ public function request(string $name, mixed $payload, Closure $handler): self
});

$this->publish($name, $payload, $sid);
$this->process(PHP_INT_MAX);
$this->process($this->configuration->timeout);

return $this;
}
Expand Down Expand Up @@ -332,7 +332,7 @@ private function send(Prototype $message): self

if ($this->configuration->verbose && $line !== "PING\r\n") {
// get feedback
$this->process(PHP_INT_MAX);
$this->process($this->configuration->timeout);
}

return $this;
Expand Down

0 comments on commit d3e9cef

Please sign in to comment.